Local functions
Neal Gafter
neal at gafter.com
Wed Feb 10 17:50:45 PST 2010
On Wed, Feb 10, 2010 at 5:34 PM, Alex Buckley <Alex.Buckley at sun.com> wrote:
> Lambda has similar high-level wording about boilerplate for parallel
> execution. I know what Stephen meant by "requirements", and a couple of
> high-level sentences was not it.
I read "The goal of this Project is to formulate a proposal to add
first-class functions, function types, and lambda expressions
(informally, "closures") to Java, and to implement a prototype
suitable for inclusion in JDK 7 so as to enable broad
experimentation." <http://openjdk.java.net/projects/lambda/>
And
"Working with parallel arrays in Java, unfortunately, requires lots of
boilerplate code to solve even simple problems. Closures can eliminate
that boilerplate." <http://blogs.sun.com/mr/entry/closures>
I cannot follow the thread of reasoning that leads from these goals to
the kinds of restrictions you're considering (e.g. denying access to
variables from the enclosing scope). Each additional restriction
becomes a source of boilerplate for programmers who must work around
those restrictions, so it would appear you should be removing
restrictions rather than adding them.
Cheers,
Neal
More information about the lambda-dev
mailing list