hello, maybe a stupid one, but I failed to find relevant documents…
I have something defined in REPL (with const
), but they’re not accessible within the functions defined within a module. What should I do?
thanks.
hello, maybe a stupid one, but I failed to find relevant documents…
I have something defined in REPL (with const
), but they’re not accessible within the functions defined within a module. What should I do?
thanks.
julia> const a = 1
1
julia> module A
using ..Main: a
println(a)
end
1
Main.A
Pass the variables as arguments to the functions.
wow… where is any documentation about ..Main
???
oh, it’s about “relative module path”.
so, in your first example, why need ..
before Main
?
I mean, when we use using
inside a module, normally we don’t need that ..
, and it would automatically search “outside”, right?
You don’t need the ..
before Main
. I just tried it.
thx