In "foo.jl"

function foo(value)

x = value

include("bar.jl")


println(bar(10))

end



In "bar.jl"

function bar(y)
return x + y
end


When I run the following code, I receive an "x not defined" error. 
 

julia> include("foo.jl")
julia> foo(10)


What is wrong here? If I define function bar(y) inside the foo(value) 
function, instead of including bar.jl, it works fine.



Reply via email to