On Friday 30 November 2007 10:54:46 istarex wrote: > What's the recommended way of implementing a partial application > language in Parrot? So far the best I've thought is to compile all > calls to an auxillary procedure that either makes a tail call to the > actual subroutine (if enough args are available to the procedure), or > else produces a thunk which stores the subroutine and the available > args.
I'd use the thunk right now, if I were doing this. > If there isn't a better way to do this, how would I get the arity of a > subroutine? I'm not sure you can from PIR, which I've argued is a problem. I think eventually we'll have to have some metadata available on invokable PMCs that lets us get the expected arity, as that will fix a nasty problem we have with NCI calls versus normal Subs. Jonathan is working on an update to our bytecode that may fix this, so there may be a solution coming. For now, the thunk seems like the most effective way to me. -- c