Instead, one thing we could do is set Parrot registers for each input
argument. So PL/Parrot functions couldn't expect normal arguments, but they
could just inspect registers when they start, to get the data they're looking
for. In PIR this is easy; I don't know how it might work in various HLLs.
In PL/Perl, input arguments are all packed into @_, and we might do something
similar by packing input arguments into an array of PMCs or something. In
PL/Python and PL/LOLCODE, input arguments are all named, and the call handler
function just creates variables in the interpreter having those names. That
technique makes perfect sense for languages with named function arguments, but
not all HLLs will have named function arguments, and I don't see a way in the
available Parrot functions to create a variable in a particular namespace.
All that, and I have no idea how to handle return types. :)
--
Joshua Tolley / eggyknap
End Point Corporation
http://www.endpoint.com
That, of course, raises this question: If we sidestep the problem of
how precisely to make the arguments appear in some way the language
can handle by sticking them in a PMC, we then have the same problem
providing the PMC in a way the language can handle. Suggestions? :)
These are some really good ideas and issues to bring up. Once we get
over the hump of being able to pass function arguments and return
values between Parrot and Postgres, a lot possibilities for other
people to hack on stuff will open up.
Deciding how to do this in a way that will work for all HLL's on
Parrot is key, but we may want to just find some solution that works
for PIR right now, so it is not blocking us from doing other stuff. I
will ponder and research this more and get back to you.
Duke
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.4.9 (GNU/Linux)
>
> iEYEARECAAYFAkuSV5cACgkQRiRfCGf1UMN3cACfX4KDes+TU0O+1v4V0TcZtCSE
> DUEAn3mFtdGxHYuiEIYsUovloWcfJ6Lv
> =qDdp
> -----END PGP SIGNATURE-----
>
>
--
Jonathan "Duke" Leto
jona...@leto.net
http://leto.net