In t2.jl
I can use both import ..MyPkg
and import ...MyPkg
, is this a feature? It seems to be safe though, because Modules cannot contain modules with the same name.
MyPkg
├── Manifest.toml
├── Project.toml
└── src
├── MyPkg.jl
├── t1.jl
└── t2.jl
MyPkg.jl:
module MyPkg
g(x) = 2 + x
include("t1.jl")
include("t2.jl")
end
t1.jl:
module SubMod1
f(x) = x^2
end
t2.jl:
module SubMod2
import ...MyPkg
import ..SubMod1
f2(x) = MyPkg.g(x) * SubMod1.f(x)
end