Delurking comments on the 0.1.5 specification
Neal Gafter
neal at gafter.com
Sat Apr 3 08:06:45 PDT 2010
On Fri, Apr 2, 2010 at 10:34 PM, Jim Mayer <jim at pentastich.org> wrote:
> One concern I do have is that if we have an invocation syntax that
> looks like a method definition, then I think we will create a lot of
> confusion for people who expect that break and continue will be
> illegal and that return will exit from the "lambda expression that
> looks like a method definition". I wonder if a lot of the "it doesn't
> look like Java" comments come from a similar place.
>
> Has anyone involved with BGCA (or similar) efforts come up with ideas
> that would help bridge that sort of "point of view" gap?
Yes. By the way, it's BGGA, the first G referring to me.
The most important thing is to ensure that lambda expressions (that
could be extended to support transparency) don't look anything at all
like method definitions so as to reduce the confusion. As for
bridging the gap, one approach is to have two forms of lambda
expression: one with curly braces (and therefore somewhat similar to a
method definitions) and one without (and therefore less similar).
That's the approach taken in CfG; see
<http://www.javac.info/closures-v06a.html> and
<http://www.javac.info/closures-v06b.html>. You previously rejected
this approach because you thought that expression lambdas are pure
syntax, but expression lambdas are transparent while statement lambdas
are not.
More information about the lambda-dev
mailing list