D isn't the only language with janky closure semantics
ltdk
khoa.alter.acc at gmail.com
Sat Aug 30 10:18:51 UTC 2025
On Friday, 29 August 2025 at 22:28:17 UTC, H. S. Teoh wrote:
>
> Now, JS is certainly not a model language to follow, but it's
> interesting how it shares with D the same issue over closures
> involving loop variables.
>
> I guess that means we're not alone. :-P Even though this
> situation is definitely not ideal.
>
>
> T
Pior to 1.22, Golang also behaves similarly. They later "fixed"
the issue: https://go.dev/blog/loopvar-preview .
C# also moved away from Dlang's behavior since C# 5, 1 member of
C# team commented about that change:
https://github.com/golang/go/discussions/56010#discussioncomment-3788526
More information about the Digitalmars-d
mailing list