Hi all, 

I have a question about modules and I am probably missing something.

Say that in file.jl I define functions foo and bar. I then create a file 
MyModule.jl where I include file.jl as:

module MyModule

include("file.jl")

end


At this point, in the REPL, doing import MyModule will give me access to 
both foo and bar. Say, however, that I only want foo to be visible from the 
outside, while I want bar to remain private, because it is some accessory 
function used in foo.

What is the preferred way to achieve this? I thought that after 
include("file.jl") 
I should have added an export foo to make it accessible to the outside, but 
the include function is making everything in file.jl visible.

Thanks, 

Davide

Reply via email to