Project Lambda: Java Language Specification draft 0.1.5
Joshua Bloch
jjb at google.com
Thu Feb 18 19:17:29 PST 2010
Neal,
On Thu, Feb 18, 2010 at 6:42 PM, Neal Gafter <neal at gafter.com> wrote:
> On Thu, Feb 18, 2010 at 5:10 PM, Alex Buckley <Alex.Buckley at sun.com>
> wrote:
> > If 'this' is banned in an expression lambda, and in returns of a
> > statement lambda, then a lambda instance's identity cannot be exposed,
> > and the question is moot.
>
> As Josh pointed out, if "this" refers to the lambda anywhere inside
> the lambda, then its identity is observable.
>
> Another problem with having "this" refer to the lambda
I don't see the observability of "this" as a problem; I see it as a
desirable feature.
that we did not
> discuss before is that it does not compose well. Specifically, a
> lambda written within another lambda has no way to refer to "this" of
> the enclosing lambda.
>
I see this as a corner case, with a workaround: the enclosing lambda can
stash its identity in order to make it available to the enclosed lambda.
Regards,
Josh
More information about the lambda-dev
mailing list