Re:Go: Redefining For Loop Variable Semantics
by zadwang on Tuesday October 11, 2022 @05:52AM
(#33161333)
You are right.
Would it be possible to add closure use as another case?
Re:Go: Redefining For Loop Variable Semantics
by zimpenfish on Tuesday October 11, 2022 @07:13AM
(#33161895)
I guess you could but now you have to special-cases that need static analysis and all that jazz. Probably easier to just put it behind a version flag.
That wouldn't fix the closure problem where the address isn't taken.