Turing goes a step further and explicitly forbids the use of an iterator variable outside of the loop its used in. In that language you dont have to declare an iterator, and it disappears as soon as the loop terminates.
And I believe the reason for this logic is that the value can be undefined depending on how the compiler handles it. Ie:
for my $i (0..10) { print "$i\n" }
Could be optimised into ten print statements with no iterator at all.
First they ignore you, then they laugh at you, then they fight you, then you win.
-- Gandhi
In reply to Re: Re: for loop localisation bug?
by demerphq
in thread for loop localisation bug?
by BrowserUk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |