Nathan, thanks for zeroing in on this paragraph from RFC 23. It raises a
question in my mind about the meaning of the RFC, and whether the paragraph is
even necessary, which could answer your question about implementation.
If a curried subroutine is truly generated because of seeing an expression
containing placeholders, then that expression contains some finite number of
placeholders. Each placeholder turns into a parameter of the generated
subroutine. The generated subroutine has, I assume, an internal name or id or
address by which it is called. However, it can only be called in exactly one
place: the place in the source code from which the subroutine was generated.
That place calls it with exactly the correct number of parameters.
Hence, unless there are additional related RFCs not yet submitted which describe
ways to define names of curried subroutines, and techniques for relating
curryable expressions such that only one subroutine is generated for multiple
curried expressions, I fail to see any way in which they can be called with
fewer than the required number of arguments.
What am I missing?
Nathan Torkington wrote:
> Perl6 RFC Librarian writes:
> > =head2 Re-currying deferred expressions
> >
> > The subroutines generated by a placeholder are not exactly like the
> > equivalent subroutines shown above. If they are called with fewer than the
> > required number of arguments, they return another higher order function,
> > which now has the specified arguments bound as well.
>
> The implementation of this might be far from trivial. The
> IMPLEMENTATION section of this RFC should address this. How would
> Perl's innards have to change to make this possible? Dan is, sadly,
> on holiday. Perhaps another internals hacker could step up and
> address this.
--
Glenn
=====
There are two kinds of people, those
who finish what they start, and so
on... -- Robert Byrne
_______________________________________________
Why pay for something you could get for free?
NetZero provides FREE Internet Access and Email
http://www.netzero.net/download/index.html