Export from a submodule

Dear all,
I trying to solve this issue, but to no avail.

I have the following module structure

Module Foo

Module Bar
export f
f(x, y) =x+y
end

using .Bar

end

I would like the function f to be visible in the REPL when I do using Foo.
I’ve tried by putting using .Bar, but to no avail.
The only way I have to access this function is Foo.Bar.f, but I would like it to be simply f.

Best wishes
Isaia

export f in Foo will do it.

or use import:

julia> module Foo

       module Bar
       f(x, y) =x+y
       end

       end
Main.Foo

julia> using .Foo

julia> import .Foo.Bar.f

julia> f(1,2)
3
1 Like