[Date Prev] [Date Next] [Thread Prev] [Thread Next] Date Index Thread Index Search archive:
Date:Mon Jul 15 18:43:11 1993 
Subject:Re: quickie test 
From:davidy (David S Young) 
Volume-ID:930715.13 

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