transparent lambda

Rémi Forax forax at
Wed Dec 30 08:30:35 PST 2009

Le 30/12/2009 17:01, Neal Gafter a écrit :
> On Wed, Dec 30, 2009 at 6:40 AM, Rémi Forax <forax at 
> <mailto:forax at>> wrote:
>     You can also use 'return' as a suffix and the name of the function
>     (in a separate scope) as prefix.
>     int f() {
>       lambda() {
>         f.return 42;
>       }.invoke();
>     }
> You could, but the resulting construct is not TCP-transparent.

Yes, I see a lambda as an anonymous function and not as an abstraction
over a statement or an expression.
That's why 'return' returns from the lambda and not from the function.

In my opinion, lambda are more like anonymous class but for function.
So like you use Outer.this in an inner class to access to the enclosing 
you should use f.return to return from a named function in an anonymous


-------------- next part --------------
An HTML attachment was scrubbed...

More information about the closures-dev mailing list