Effectively final effective?

Alex Blewitt alex.blewitt at gmail.com
Wed Feb 24 15:16:29 PST 2010


On 24 Feb 2010, at 23:04, Mark Thornton wrote:

> Neal Gafter wrote:
>> It isn't just the visual noise that people find so bothersome.  The
>> restriction itself is also bothersome, and harder to work around.
> Yet would not many developers be surprised to discover that they 
> couldn't change an apparently ordinary local variable because it had 
> been captured by a lambda (or anonymous inner class) some lines previously.

That's my concern too. The fact that it has to be final (save tricks like one-element arrays, atomic refs etc.) is part of documenting that restriction. Simply allowing it to be omitted doesn't change the fact that it is final.

Would it be worthwhile asking the question of a larger audience to get their thoughts? Or have those at Sun/Oracle already done so at some point? As with 'most' other people, the set of who 'most' is is an interesting question, particularly since I wonder if the question had been asked in any other language than English :-)

Alex


More information about the lambda-dev mailing list