On Saturday, 11 December 2021 at 15:15:06 UTC, Matheus wrote:


I'm just a bit intrigued by your last sentence. Is there anything evil this may result or anything that I should be aware of?

Besides it looks like an error, you may think that it just introduces a scope which can be referenced by the for-loop but this only works in the initialization section. See what happens if you want to do more steps at iteration for this fancy looking syntax:

```d
// iteration works, but scope behind does nothing
for({int i=0; j=0;} i<10; ++i, {++i; ++j;} ){}

// endless loop
for({int i=0; j=0;} i<10; {++i; ++j;} ){}
```

Not sure if bug or feature but it is inconsistent for me and thus a reason to avoid it.

Reply via email to