transparent lambda
Neal Gafter
neal at gafter.com
Wed Dec 30 08:38:20 PST 2009
On Wed, Dec 30, 2009 at 8:30 AM, Rémi Forax <forax at univ-mlv.fr> wrote:
> 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
> class,
> you should use f.return to return from a named function in an anonymous
> function.
>
That's certainly a consistent position, but it's not as useful. Writing
methods that act as control structures would require callers to reorganize
their code to use these control APIs.
If you're going to bother to support nonlocal transfers, you might as well
make the lambdas transparent and get the full benefits.
Cheers,
Neal
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.openjdk.java.net/pipermail/closures-dev/attachments/20091230/44dffddc/attachment.html
More information about the closures-dev
mailing list