I think this is the soft vs hard scope issue. See: https://github.com/JuliaLang/julia/issues/9955
That issue could use some fleshing out though... On Tue, 2015-03-10 at 20:03, Wendell Zheng <zhengwend...@gmail.com> wrote: > *Input 1:* > y = 0 > function foo() > y = 10 > end > foo() > y > > *Output 1:* > 0 > > *Input 2:* > y = 0 > for i = 1:1 > y = 10 > end > y > > *Output 2:* > 10 > > In the first example, y introduces a local variable. > In the second example, y is still a global variable. > > This is not consistent to what the official document said. > > I tried these examples in JuliaBox.