Calling functions whose signature/arguments are only known at runtime
wknight8111 at gmail.com
Tue Mar 16 19:19:54 UTC 2010
My initial thought, and this isn't implemented quite yet (though we
could put the fire back to my feet to complete it) is to create a
CallContext PMC with all the arguments you want and pass that in.
Putting arguments into a ResizablePMCArray or Hash and using :flat
(Signature "Pf") would similarly resolve the problem.
On Tue, Mar 16, 2010 at 3:03 PM, Jonathan Leto <jaleto at gmail.com> wrote:
> 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 ,
> 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.
>  http://github.com/leto/parrot/commit/8e0861f98c943bcd64d3563362085c0c68aac40e
> Jonathan "Duke" Leto
> jonathan at leto.net
More information about the parrot-dev