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.

> When Perl sees an expression containing a placeholder, it creates a
> curried expression around this placeholder that is as large as possible,
> stopping when it reaches a halting rule. In an expression containing
> multiple placeholders, the placeholders are only combined into a single
> curried expression where there is no halting rule between them.

How grammable is this?  That is, it's easy to describe but how would
it affect Perl's parsing process?  Can you suggest ways in which this
might be done?

> Implementation of the 'higher' pragma is left as an exercise to the
> reader ;-)

But as the proposer, it's your responsibility to make sure that
someone thinks about it.  Something that will cause as dramatic a
change in the language as currying must address implementation, or
it's just a useless wish that Larry will look at and say "well,
yes, but can it be done without buggering the rest of Perl?" (perhaps
not in those words :-)

Considering implementation now will save us time later.  You don't
have to spec out data structures or grammar, but just show how it
might be done.

Nat

Reply via email to