I'm starting REPL and then using include("./main.jl")
multiple times to speed up script loading.
After the first run it starts giving warnings:
WARNING: replacing module Lib.
WARNING: using Lib.somefn in module Main conflicts with an existing identifier.
How to suppress it?
You should use Revise
and then includet("./main.jl")
(note the 't' at the end of includet
, standing for "track"). From there on, whenever you make a change to file "main.jl", these changes are reflected in the REPL, without warning.
Example:
module Lib
somefn() = 42
end #module
julia> using Revise
julia> includet("main.jl")
julia> Lib.somefn()
42
# modify the definition of somefn in main.jl and save the file
julia> Lib.somefn()
43
NB: If Revise
is not already installed on your system, you might have to install it first:
julia> using Pkg
julia> Pkg.add("Revise")
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With