Nice to @Share?

Neal Gafter neal at gafter.com
Tue Feb 23 11:17:31 PST 2010


On Tue, Feb 23, 2010 at 11:08 AM, Joshua Bloch <jjb at google.com> wrote:
> Neal,
>
> On Tue, Feb 23, 2010 at 1:39 AM, Neal Gafter <neal at gafter.com> wrote:
>
> The definition of "local variable" in (§4.12.3) is "Local variables
>> are declared by local variable declaration statements (§14.4).
>> ....<snip>... The local variable effectively ceases to
>> exist when the execution of the block or for statement is complete."
>>
>> The only part of that requiring rewording in the presence of lambdas
>> that can access local variables from the enclosing scope is the last
>> sentence.
>
>
> It's only one sentence, but it's a *huge* conceptual change, and not one I
> see as justifiable.

Too bad, because the sentence is already incorrect.  Local variables
that happen to be final and used in an inner class do not cease to
exist when the execution of the block is complete.  Removing the
"final" requirement doesn't change whether or not that sentence is
correct.


More information about the lambda-dev mailing list