Until now, I was used to having a file containing a module with some parameters, usually set with const
keyword. This is very similar to a singleton - the design pattern, not the Julian singleton - and guarantees that anywhere in the code the configuration variables that I am using are the same.
During an interactive session, I just did include("src/myincludes.jl"); MyModule.main()
to run the code while testing various parameters.
Today, I have some issues with JLD and type identity, for which I need to reload some file. For this reason, I am now using Revise. However, Revise I cannot reproduce the same workflow.
For instance, suppose having the following 4 files:
# A.jl
module A
const a = 6
b = 6
end
# B.jl
module B
using Main.A: a, b
function test()
println(a, b)
end
end
# C.jl
module C
using Main.B: test
function main()
test()
end
end
# D.jl
using Revise
__revise_mode__ = :eval
includet("A.jl")
includet("B.jl")
includet("C.jl")
During an interactive session, I run:
julia> include("D.jl");
julia> B.test()
66
julia> C.main()
66
Then, I change the values in A.jl
and retry, but the output is still the same
julia> include("D.jl");
julia> B.test()
66
julia> C.main()
66
What is the most similar workflow to the one I am used while using Revise? I really need to have a module with many const values in it and to change those values in a running session.