Why does this give me an error ERROR: ParseError("invalid iteration specification")


#1
julia> for i in [1:3;], for j in [4:6;]
          println(i, " ", j)
       end
ERROR: ParseError("invalid iteration specification")
Stacktrace:
 [1] #parse#236(::Bool, ::Bool, ::Function, ::String, ::Int64) at ./parse.jl:222
 [2] (::Base.#kw##parse)(::Array{Any,1}, ::Base.#parse, ::String, ::Int64) at ./<missing>:0
 [3] #parse#237(::Bool, ::Function, ::String) at ./parse.jl:232
 [4] macro expansion at /home/devel/.julia/v0.6/Atom/src/repl.jl:118 [inlined]
 [5] anonymous at ./<missing>:?

I’m using Julia 0.7.


#2

You want for i in [1:3;], j in [4:6;] … don’t repeat the for keyword.