On Tue, 04 Jun 2013 23:48:32 +0200
Timon Gehr <timon.g...@gmx.ch> wrote:
>
> Behind the scenes, the foreach loop is rewritten to something like:
> 
> for(int __a=0;__a<5;__a++){
>      int a = __a;
>      writeln(&a);
> }

Yea, I think the years I spent using C has corrupted my brain into
seeing...

   foreach(int a; 0..5)

...as shorthand for:

   for(int a=0; a < 5; a++) { /* use a */ }

Which is something I wrote far too many times in the 90's ;)

Reply via email to