I see codes like
using pkg1
using pkg1.mod1
using pkg1.mod1: fun1, fun2
Why is a single ‘using pkg1’ not enough?
I see codes like
using pkg1
using pkg1.mod1
using pkg1.mod1: fun1, fun2
Why is a single ‘using pkg1’ not enough?
Consider package A
that looks like this:
module A
export f_A
f_A() = 1
module B
export f_B
f_B() = 2
g_B() = 3
end
end
Then:
using A
f_A() # returns 1
f_B() # not defined
g_B() # not defined
A.B.g_B() # returns 2
A.B.g_B() # returns 3
using A.B
f_B() # returns 2
g_B() # not defined
B.g_B() # returns 3
using A.B: g_B
g_B() # returns 3