Revise not working with module scripts

I am trying to compare two versions of a script. I wrapped them in modules so I can compare their intermediate values by name in the REPL, but the values are not updated when I save. Is that expected? Is there a better workflow for this process?

module A
...
x = 1.0
y = 2x
...
end
module B
...
x = 2.0
y = 2x
...
end
julia> using Revise

julia> includet("FileA.jl")

julia> includet("FileB.jl")

julia> A.x ≈ B.x
false

Now changing x and saving the file isn’t updating the values in my REPL session.

Check the “Extended help” section in User reference · Revise.jl. It describes what you observe.

I am not sure what would be the best workflow for your exact case. Maybe have a function return x and y? If you change that function, Revise will reload it.

2 Likes