EDIT: In the end it had nothing to do with it. I'm answering for anyone in a similar situation.
I discovered Julia a month ago and have been fascinated with it since then. However, it seems compilation (or a variable scope) is still not clear for me.
I have this module in plots.jl
:
module plottinghhkp
instance_path = "somestring"
function dosomething()
...
end
...
end
and then include it in the REPL to run module functions
julia> include("plots.jl")
...
julia> hhkplot.instance_path
julia> "somestring"
I then modify instance_path
, and re-import using include
again, but instance_path
shows old value instead of the new value:
julia> include("plots.jl")
...
julia> plottinghhkp.instance_path
"somestring"
My solution was to rename the variable to instancepath
so that a new symbol is created, however, autocomplete now shows:
julia> plottinghhkp.
instance_path instancepath
julia> plottinghhkp.instancepath
"newvalue"
julia> plottinghhkp.instance_path
"somestring"
when the instance_path symbol does not exist anymore in the module.
Creating a fresh environment with workspace()
never ends.
Why is this happening? Do I need to explicitly load Julia with no precompiling, or add __precompile__(false)
to the module? Or is it something about the variable scopes?
Thanks.