Lambda and JSR 292 method handle

Mark Mahieu markmahieu at googlemail.com
Thu Dec 17 16:29:51 PST 2009


On 17 Dec 2009, at 21:14, John Nilsson wrote:

> On Thu, Dec 17, 2009 at 5:03 PM, Rémi Forax <forax at univ-mlv.fr> wrote:
> 
>> You don't need a class. There is a special operation named insertArguments
>> that allow to specify the first arguments of a method handle in order to
>> create
>> another method handle. This operation is commonly called currying.
> 
> 
> In reference to the earlier thread about being careful about terminology it
> would be more correct to call it partial application.
> 
> Currying is the act of taking #R(A1,A2,...,An) and turn it into
> ###...#R(An)...(A2)(TA1)
> (I must say that this type syntax isn't really nice to higher order
> functions ... )
> 
> BR,
> John
> 


The syntax isn't really nice to a couple of other things either, once you move away from simple 'soundbite' examples.

And I'm also glad you raised the distinction between currying and partial application; there have been numerous requests to support 'currying' closures/lambdas during related discussions, but it has rarely been clear whether the perceived need really is for currying or for partial application, and moreover what use cases the person requesting it has in mind.

Whichever it is that people are after, a few examples of envisaged usage would be a big help.

Mark



More information about the lambda-dev mailing list