Too terse and too alien?
Neal Gafter
neal at gafter.com
Tue Jun 1 14:02:08 PDT 2010
On Tue, Jun 1, 2010 at 12:35 PM, Alessio Stalla <alessiostalla at gmail.com>wrote:
> I agree to having only a single syntax, #(int i) {return i * i;}. An
> extra return won't make much difference, and special-casing closures
> with a single expression as their body makes it slightly inconvenient
> to change them in case you later need to have more than an expression.
> Consider also that Java is not a functional language, and its
> expressions are limited to math, assignments, comparisons, and ternary
> conditionals; if, try-catch, switch, etc. are not expressions, so I
> think single-expression closures will be seldom used anyway.
>
I think single-expression closures will be the most common form, especially
in the context of the kinds of aggregate (possibly concurrent) operations
that is cited as the primary motivation for adding closures at this time.
An extra return does make a difference, particularly if we ever hope to more
fully support transparency ala BGGA in a future extension.
More information about the lambda-dev
mailing list