Status: R
From jonr:
> Clearly, I would like to be able to write:
>
> define get_results( p );
> lvars p;
> [% p() %]
> enddefine;
>
> : get_results( [a b c], dest ) =>
> ** [a [b c]]
>
> Any ideas for how to write this?
I don't think you can do it at all unless you are willing to trust that
the pdnargs of p has been set correctly. If so, you can write (not very
elegantly):
define get_results(/* Args for p */ p) -> l;
lvars p, l, n = pdnargs(p), np1 = n+1;
[% p(repeat n times subscr_stack(np1) endrepeat) %] -> l;
erasenum(n)
enddefine;
which assumes that [%...%] is implemented with a stack marker.
David Young
|