It’s a (M)inimal (W)orking (E)xample.
You’re still including that file twice, which will still create two modules. The first module will be the one Load
sees and binds to, then in methods.jl
you create a new Structs
module which is what Methods
sees and binds to (and which overwrites the binding created in load.jl
).
I don’t know why you’re creating submodules for the structs in particular, I’d just have them defined like so:
poet.jl
module Poet
include("structs.jl")
include("methods.jl")
end
structs.jl
struct myStruct
...
end
modules.jl
function method(strt::myStruct)
"I got called"
end