foreach on interval index by ref increment

bearophile bearophileHUGS at lycos.com
Sat Jan 21 20:10:08 PST 2012


Andrej Mitrovic:

> I've had a use for it recently in some string processing, and I quite
> liked it that all I had to do was make my index ref just to skip an
> element. If I couldn't do that then I'd have to create a state
> variable or use the ancient for loops.

It's bad code, that relies on a not intuitive special case.
I suggest you to use a more clean and readable ancient for loop for that purpose.
Relying on magical syntax is not a good idea for production code.

Bye,
bearophile


More information about the Digitalmars-d mailing list