I know, this topic again. After a year I thought I understood this well enough, I was wrong. I expect this to work but it doesn’t. I don’t want to declare b as a global here, just access it inside the function.
function foo() for i in 1:10 b=rand() end print(b) end
But it works if I initialize it…why?
function bar() b=undef for i in 1:10 b=rand() end print(b) end