On Thursday, 23 September 2021 at 00:30:45 UTC, Ruby The Roobster wrote:
I figured out something weird. The variable 'i' is passed by reference, yet the variable 'i' of the loop isn't being incremented by posfunc. I assume foreach creates a new i variable at the start of each new loop.

Yep:

```
$ rdmd --eval 'foreach (i; 0 .. 5) { writeln(i); i++; }'
0
1
2
3
4
```

Reply via email to