I am making the move from 0.6 to 0.7 and transitioning from a reload("MyModule"); include("myscript.jl")
workflow to a Revise-based workflow as recommended in the deprecation warning for reload
. I am using the setup described in the Using Revise by default section of the documentation.
I’ll try to demonstrate the issue I am having with a MWE module called MyMod
that goes through three versions and it seems like Revise
falls a version behind and can’t get me up to the latest version of MyMod
. Here’s what I see from within julia (version 0.7.0) as I go through this:
julia> import MyMod #importing version 1 of MyMod
[ Info: Precompiling MyMod [39b22132-abcb-11e8-1d53-e5fa610b8d45]
julia> revise(MyMod) #calling revise after going to version 2 of MyMod
true#note that "asdf" is not printed as I would anticipate for version 2
julia> revise(MyMod) #calling revise after going to version 3 of MyMod
asdf #now it prints "asdf"!
true #however, it doesn't print "blah" as I would anticipate for version 3 -- it seems like I am at version 2
julia> revise(MyMod) #calling revise again with the code still at version 3 of MyMod
true #neither "asdf" nor "blah" isn't printed -- still doesn't appear as if version 3 has been loaded
Here are the different versions of MyMod:
Version 1:
module MyMod
macro mymacro()
:(1)
end
@mymacro
end
Version 2:
module MyMod
macro mymacro()
println("asdf")
:(1)
end
@mymacro
end
Version 3:
module MyMod
macro mymacro()
println("asdf")
println("blah")
:(1)
end
@mymacro
end
The only way I can see to get to version 3 with a Revise
-based workflow is by starting a new julia session. With the reload
-based workflow I could have just reload
ed and not had to restart julia. Given that the purpose of Revise
is to reduce the number of times you have to restart julia (and given Tim Holy’s godlike julia prowess), I feel as if I am missing something or doing something wrong.
Is there a way to get to version 3 with a Revise
-based workflow without restarting julia? With julia 0.7, is there a simple way that I can be confident that the latest version of my module has been loaded aside from restarting julia?