Implementing recursive lambda with MethodHandle

Alex Blewitt alex.blewitt at gmail.com
Tue Feb 23 03:49:58 PST 2010


On 23 Feb 2010, at 11:22, <David.Moss at ubs.com> wrote:

> But,
> Retargeting 'this' -1
> 
> Because I think it is a really bad idea.

There are others that share your opinion on this list. :-) 

But if we've blown transparency with the lack of (non-final) variable capture, returns/continue/break acting differently from within a lambda than outside, there doesn't appear to be any argument against having 'this' as meaning something different inside a scope as well, other than personal expectations. Note also that existing Java developers are familiar with their being multiple 'this' inside nested inner classes, and I'm sure the same objections came up at that time.

If we end up introducing the transparency for 'returns/continue/break' then I'm all for consistency in using 'this' to be transparently referring to the enclosing class instance. But equally, if we don't have transparency - and thus, can never surround a block of code without potentially inspecting it for changes - then it seems that we're suffering an awful lot of contortions based on personal opinion.

Lastly, we still can't use 'this' transparently in the 0.1.5 spec, since 'this' is explicitly disallowed at the current time.

Alex


More information about the lambda-dev mailing list