How to import custom module in julia

后端 未结 7 2173
抹茶落季
抹茶落季 2020-12-08 19:35

I have a module I wrote here:

# Hello.jl
module Hello
    function foo
        return 1
    end
end

and

# Main.jl
using Hel         


        
7条回答
  •  生来不讨喜
    2020-12-08 19:52

    If you want to access function foo when importing the module with "using" you need to add "export foo" in the header of the module.

提交回复
热议问题