I am using the REPL workflow described in REPL Workflow.
Suppose the contents of Tmp.jl are as follows:
module Tmp
export say_hello
say_hello() = println("Hello!")
# your other definitions here
end
And the contents of tst.jl are:
include("Tmp.jl")
#import .Tmp
using .Tmp # we can use `using` to bring the exported symbols in `Tmp` into our namespace
#Tmp.say_hello()
say_hello()
# your other test code here
Now if I edit the say_hello() function and do include('tst.jl') the function definition is not updated in REPL. This problem goes away if I call the function as Tmp.say_hello(). Is this the expected behaviour?
I think that’s expected. Here’s what I get when I run the test script after having modified say_hello:
julia> include("Tst.jl")
Hello!
julia> include("Tst.jl")
WARNING: replacing module Tmp.
WARNING: using Tmp.say_hello in module Main conflicts with an existing identifier.
Hello!
The second warning says that the new say_hello conflicts with the old one. So, the old definition is kept (though the new definition is still available within the new Tmp module).
So, I think the only realistic way to use the workflow mentioned in the manual is to import the Tmp module and use the qualified Tmp.say_hello() in your test script.
That works. Thanks. I had to first do includet("Tst.jl") and then again do include("Tst.jl") to execute the whole file.
I had not tried earlier with includet but with the Pkg centric usage. There the exported functions did not seem to update. But I might have done it wrong.