I am moving from Julia 0.7 to 1.0. It seems that Julia\'s rule for the scope of variables changed from 0.7 to 1.0. For example, I want to run a simple loop like this:
Just remember that inside a function you won't use global, since the scope rules inside a function are as you would expect:
global
function testscope() num = 0 for i = 1:5 if i == 3 num = num + 1 end end return num end julia> t = testscope() 1
The unexpected behaviour is only in REPL. More on this here