Hey all,
I’m trying to run a reloading workflow just one step in complexity above the basic workflow as described in the manual.
I have a MWE which I believe fits the same pattern as given in the manual, but still does not seem to work. Can anyone tell me why?
My workflow
julia --project=@. -i reloader.jl
> reload()
"Hello world"
> # now edit JuliaIncludeTest to say "Goodbye world"
> reload()
WARNING: replacing module JuliaIncludeTest.
"Hello world" # wtf? it said it was replaced!
Thanks for the suggestion, but I started down this track (of working back to an MWE) because Revise wasn’t working for me either (for different reasons, some weird behaviour with Requires I think). So I started down the path of “reproduce as simply as possible”. Now I’m intrigued why this method doesn’t work, as it seems to contradict the manual saying that include() should redefine included modules!
The reason why your reload function doesn’t work the way you expect it to is that it is compiled before it runs. At compile-time JuliaIncludeTest.greet() refers to a different function, because the include has not happened yet.