Reuse 'do' keyword instead of hash sign (#)
Jack Moxley
jack at moxley.co.uk
Mon Jun 20 08:11:23 PDT 2011
I do know that they arn't objects, Its difficult to find the correct word to use. Would function pointer be more suitable?
_____
From: Brian Goetz [mailto:brian.goetz at oracle.com]
To: lambda-dev at openjdk.java.net [mailto:lambda-dev at openjdk.java.net]
Sent: Mon, 20 Jun 2011 14:38:38 +0100
Subject: Re: Reuse 'do' keyword instead of hash sign (#)
> I think you misunderstood me, I suppose it really depends on whether
> you conceptually consider lambda expressions to be objects and thus
> typed, or you don't. Which I, for right or wrong do.
I would say that intuition will work against you in the long run.
Lambda expressions are not objects. They don't have an object identity.
The 'this' keyword, if it means anything in the context of a lambda,
is the *enclosing* object, not the target of the SAM conversion.
Lambda expressions are *converted to* an object -- an instance of a SAM
type. (A reasonable analogy is the type of 'null' -- null is
assignment-compatible with multiple reference types, but is not
intrinsically of type Object.) The object-nature of this converted
value is not discernable from within the lambda -- and eventually will
be optimized away by the VM.
In a future possible version of Java that has reified function types,
lambda expressions will be function-typed, and functions are not
(necessarily) objects.
More information about the lambda-dev
mailing list