Closed GoogleCodeExporter closed 9 years ago
Issue found as a consequence of the tests & updates related to Issue 135
Original comment by krustev....@gmail.com
on 15 Apr 2012 at 10:27
Original comment by krustev....@gmail.com
on 8 May 2012 at 11:10
The issue is fixed in r2150 and r2151
Now in case a list variable stays as a second argument of foreach - it will
pick-up all changes that the loop iterator gets.
Here is an example:
int list a = {0,1,2,3,4,5};
foreach(int i; a)
i = i+1;
echo(a);
<= list members: { 1 , 2 , 3 , 4 , 5 , 6 }
As a bonus - foreach does not require typed anonymous variables anymore (they
are still acceptable for compatibility) - i.e. now the expression
foreach(int i; {0,1,2,3,4,5}) printf("%d ",i); printf("\n");
//will happily produce
0 1 2 3 4 5
Original comment by krustev....@gmail.com
on 9 May 2012 at 12:06
Original comment by krustev....@gmail.com
on 12 May 2012 at 1:30
Original issue reported on code.google.com by
krustev....@gmail.com
on 15 Apr 2012 at 6:28