模块1代码: precompile(false)
module TempModule2
export print2,print3
function print2()
println(“function print2()”)
end
function print3()
println(“nw molde”)
end
end
模块2调用:
module test
using TempModule2
print2()
print3() #这个调用报错了
end
julia> module TempModule2
export print2,print3
function print2()
println("function print2()")
end
#function print3()
#println("nw molde")
#end
end
Main.TempModule2
julia> module test
using ..TempModule2
print2()
print3() #这个调用报错了
end
function print2()
ERROR: UndefVarError: print3 not defined
Stacktrace:
[1] top-level scope at none:0
julia> module TempModule2
export print2,print3
function print2()
println("function print2()")
end
function print3()
println("nw molde")
end
end
WARNING: replacing module TempModule2.
Main.TempModule2
julia> module test
using ..TempModule2
print2()
print3() #这个调用报错了
end
WARNING: replacing module test.
function print2()
nw molde
Main.test