JuliaLang/julia — Issue #424: while loop; variable not defined in script
Author: alexalemi
Created: 2012-02-20 23:32:11+00:00
State: open

Very interesting language, however there seems to be a rather nasty bug in the way while loops handle variables.
The following code

x = 0
while x < 10
println(x)
x += 1
end

if entered into the julia intepreter as two lines, works. Something like it even appears as an example in the manual, but as a script, executed as julia testloop.j, gives the following error

x not defined
in include, src/boot.j:192
in process_options, pathtojulia/julia/j/client.j:163
in _start, pathtojulia/julia/j/client.j:201
at testloop.j:2

Similarly, loading the script with

load("testloop.j")

gives the same error on the first load, but not on subsequent loads.