Local functions
Alex Buckley
Alex.Buckley at Sun.COM
Tue Feb 9 17:34:35 PST 2010
Initial reaction: local functions are a step too far, even if they do
have a straightforward translation to lambdas.
Neal Gafter wrote:
> The traditional distinction between functions and methods is that
> methods are defined in an object scope, and therefore the object's
> members are in scope. Functions, on the other hand, are defined in
> whatever scope they are declared in, and therefore inherit their
> lexical scope (including, e.g., "this") from their point of
> declaration.
And with that, how could anyone argue against lexical 'this'? :-)
My concern about lambdas duplicating the functionality of anon.inner
classes has led me to think about dropping statement lambdas, keeping
expression lambdas, and then adding block expressions. (I am avoiding
saying anything about 'this' in such circumstances.)
Alex
More information about the lambda-dev
mailing list