Local functions
Neal Gafter
neal at gafter.com
Wed Feb 10 16:21:04 PST 2010
On Wed, Feb 10, 2010 at 2:35 PM, Alex Buckley <Alex.Buckley at sun.com> wrote:
> That said, I am happy to prioritize parallel use cases over non-parallel
> use cases. Sun is not aiming to add lambdas to allow control abstraction
> or DSL building, but rather to support FJ ParallelArray and APIs like
> it. So I'm fine if lambda bodies are restricted along the lines Doug
> suggested. ("Ideally, for the sake of parallel execution, we'd disallow
> automatic sharing of locals and automatic elevation of "this", "return"
> or "break" to enclosing scopes.") The Lambda strawman is at odds with
> some of those restrictions; resolution is forthcoming.
Interesting. The point of disallowing the use of "this" would be,
presumably, that the enclosing object might be mutable. By that same
precise logic, we should disallow access to members of the enclosing
class as well (after all, the "this" variable is itself final, while
its members might not be).
More information about the lambda-dev
mailing list