How to reload a module in Julia 1

Hello!
Do I have to reload julia if I just need to make a small change inside a module? What is the correct way to handle this?

For example, I created a big module mtest.

julia> using mtest
[ Info: Precompiling mtest [top-level]

But, forget an ‘export’ statement inside:

julia> f1()
ERROR: UndefVarError: f1 not defined
Stacktrace:
 [1] top-level scope at none:0

After I fix the corresponding module file, how to load the changes to Julia?
require looks like not working…


julia> require(mtest)
ERROR: UndefVarError: require not defined
Stacktrace:
 [1] top-level scope at none:0

julia> Base.require(Main, :mtest)
mtest

julia> using mtest

julia> f1()
ERROR: UndefVarError: f1 not defined
Stacktrace:
 [1] top-level scope at none:0

Best regards, Igor

Try using Revise.jl

3 Likes

It works!! Thank you Stefan and Tim!