小编Cir*_*exe的帖子

Julia:`import` 和 `using` 的用例

So I read the documentation for using and import in Julia. However what this does not tell me is how I should be using these two statements in practice (and, given the lack of orthogonality, this is not too easy).

Case in point: let's put the following trivial code in "myfile.jl":

module MyModule
f() = 1
export f
end
import .MyModule # or: using .MyModule
Run Code Online (Sandbox Code Playgroud)
  • if I use import on the last line, then f is not exported to …

julia

11
推荐指数
1
解决办法
526
查看次数

标签 统计

julia ×1