# Export from a submodule

**URL:** <https://discourse.julialang.org/t/export-from-a-submodule/34081>\
**Category:** New to Julia\
**Created:** [February 2, 2020, 1:45pm UTC](https://discourse.julialang.org/t/export-from-a-submodule/34081 "2020-02-02T13:45:20Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Isaia\_Nisoli](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/isaia_nisoli/32/12594_2.png) [@Isaia\_Nisoli](https://discourse.julialang.org/u/Isaia_Nisoli)\
**Post date:** [February 2, 2020, 1:45pm UTC](https://discourse.julialang.org/t/export-from-a-submodule/34081/1 "2020-02-02T13:45:20Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![hendri54](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/hendri54/32/9621_2.png) [@hendri54](https://discourse.julialang.org/u/hendri54)\
**Post date:** [February 2, 2020, 2:30pm UTC](https://discourse.julialang.org/t/export-from-a-submodule/34081/2 "2020-02-02T14:30:22Z")

</div>

`export f` in `Foo` will do it.

---

<div class="post-metadata">

**Author:** ![pbayer](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/pbayer/32/11675_2.png) [@pbayer](https://discourse.julialang.org/u/pbayer)\
**Post date:** [February 2, 2020, 2:39pm UTC](https://discourse.julialang.org/t/export-from-a-submodule/34081/3 "2020-02-02T14:39:39Z")

</div>

or use `import`:

```julia
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

```
