Implementing recursive lambda with MethodHandle

Alex Blewitt alex.blewitt at gmail.com
Tue Feb 23 05:49:45 PST 2010


On 23 Feb 2010, at 12:27, Peter Levart wrote:

>> 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,
> 
> These are all restrictions that make such code illegal (doesn't compile) and not, as you claim, "acting differently"...

That's not strictly true. You can still use break/continue/returns inside the lambda; but they have potentially different meaning htan before. (Jumping to a label outside may be a compile error; but return-from-lambda will be compilable and be different than return-from-enclosing-emthod.)

>> there doesn't appear to be any argument against having 'this' as meaning something different inside a scope as well, other than personal expectations.
> 
> Now this is something that will compile, one way or another. It's just semantics of "this" that are questioned.

Like the semantics of 'return' being questioned as well? 

>> Lastly, we still can't use 'this' transparently in the 0.1.5 spec, since 'this' is explicitly disallowed at the current time.
> 
> Only in expression lambdas or return statements of statement lambdas, If I remember correctly.

This still means there are code segments which cannot be converted into an (expression) lambda, so the transparency argument is already broken for those cases.

Alex


More information about the lambda-dev mailing list