Calling functions whose signature/arguments are only known at runtime

Jonathan Leto jaleto at gmail.com
Tue Mar 16 19:03:59 UTC 2010


Howdy,

Recently on #parrot, eggyknap++ asked this question:

<eggyknap> davidfetter and I are embedding parrot in postgresql, and
are under the impression we should use Parrot_ext_call(). The problem
is that requires us to know at compile time the functions arguments,
which we can't do.
<Coke> davidfetter: ... can't you just dynamically construct the
signature string?
<eggyknap> The signature string is easy. But the arguments themselves
aren't. Parrot_ext_call() takes a signature string and a varargs list
of arguments
...
<Coke> eggyknap: I wonder if we could take a container PMC or
something and let you use :flat.

After doing a little research, it seems that plobsing++'s work on the
Parrot_ext_call_cb function in the tt1477 branch is what we need [0],
but I would like to be sure and ask for additional comments about the
best way to go about this. We want a solution that will work for
stored procedures written in any language sitting on top of Parrot,
not just PIR, but for the time being, we are more than happy to get
just PIR working.

Your comments and constructive criticism would be greatly appreciated.

Duke

[0] http://github.com/leto/parrot/commit/8e0861f98c943bcd64d3563362085c0c68aac40e

-- 
Jonathan "Duke" Leto
jonathan at leto.net
http://leto.net


More information about the parrot-dev mailing list