3 ms·
> The issue is not restricted to variables declared in loop headers, so the proposed loop change for Go might only be the start. Technically it’s not but pract
by masklinn 4y ago
> The issue is not restricted to variables declared in loop headers, so the proposed loop change for Go might only be the start.
Technically it’s not but practically it’s by far the most common way for this to unexpectedly arise.
The other cases like closing over a variable and then modifying it before the closure is invoked are a lot less common to hit unexpectedly, and a lot harder to fix nicely (short of Java’s big hammer).