I actually wonder if the bug is that Versions 1 and 4 *should* produce an 
error, but they secretly work.  In your version 1:

for i=1:2
    if i>=2; println(z); end 
    z="Hi" 
end 

z should be local to each iteration of the loop, so I think the second pass 
should produce an undefined error. See from the manual:

for loops and comprehensions have a special additional behavior: any new 
> variables introduced in their body scopes are freshly allocated for each 
> loop iteration. Therefore these constructs are similar to while loops with 
> let blocks inside:


Am I missing something?

On Thursday, April 30, 2015 at 9:40:29 AM UTC-4, Sisyphuss wrote:
>
> I filed an issue: https://github.com/JuliaLang/julia/issues/11065
>
>
>>

Reply via email to