JDK-8300691 - final variables in for loop headers should accept updates

Archie Cobbs archie.cobbs at gmail.com
Fri Oct 25 15:02:20 UTC 2024


On Wed, Oct 23, 2024 at 2:28 PM John Rose <john.r.rose at oracle.com> wrote:

> That’s why I think we should use apply the (helpful? interesting?) idea of
> final-shadowing exactly in this one circumstance where it will cause very
> much more benefit than surprise.  (Do we use final-shadowing again?  Maybe
> not, but for me it is a clarifying concept.)
>

I like the "final shadowing" concept... at least the name seems to
accurately reflect what it is.


> P.S. Archie, I don’t think character positions should be appealed to;
> that’s not a natural tactic for the JLS.


I agree that the definition of "quiescent" is contrived, though it does end
up with an interesting/nice outcome... maybe that's just two wrongs making
a right (the other "wrong" being the mismatch between the lexical and
logical structure of the basic for() statement).

Is there some quasi-consensus to go forward with this idea for fixing basic
for() loops?

I'm not the final judge on that, but if so I'm happy to contribute any
further grunt work when needed.

In any case, this has been an interesting discussion.

-Archie

-- 
Archie L. Cobbs
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.openjdk.org/pipermail/amber-dev/attachments/20241025/7a9a5ace/attachment.htm>


More information about the amber-dev mailing list