I was going to submit this as a patch, but I ended up with a conflict, and Dan threatened he wouldn't apply it anyway, so I'll just post it here for comment. Feel free to apply any or all of it. I would be very happy to hear of a better way to answer the first question. =-)
=head2 How do I generate a sub call with a variable-length parameter list in PIR?
This is currently not trivial. Since there are no PIR or PASM syntax aids
As an example, let's say you want to call a method with three arguments, but
Where you'd replace C<...> with a C<Data::Escape::String>'d version of the
Since you're generating this C<_disposable> sub on the fly, you now generate
($I0,$S0) = _sub($P1,$P2,$P3)
You can, of course, replace the invocation to use a Sub-like PMC instead of
Finally, pass along the return values to your caller.
Then, you need to invoke the PIR compiler to compile this disposable sub,
.local pmc pir_compiler
Now, you can run your code.
$P1 = find_global "_disposable"
This process may be streamlined in the future.
=head2 How do I retrieve the contents of a variable-length parameter list being passed to me?
The easiest way to do this is to use the C<foldup> opcode to take a variable
If you have a few fixed parameters, you can use a variant of
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.