# Is Julia able to export a module as another (aliased) name?

**URL:** <https://discourse.julialang.org/t/is-julia-able-to-export-a-module-as-another-aliased-name/30814>\
**Category:** General Usage\
**Tags:** question, package, development\
**Created:** [November 7, 2019, 2:33am UTC](https://discourse.julialang.org/t/is-julia-able-to-export-a-module-as-another-aliased-name/30814 "2019-11-07T02:33:37Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![singularitti](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/singularitti/32/17678_2.png) [@singularitti](https://discourse.julialang.org/u/singularitti)\
**Post date:** [November 7, 2019, 2:41am UTC](https://discourse.julialang.org/t/is-julia-able-to-export-a-module-as-another-aliased-name/30814/2 "2019-11-07T02:41:11Z")

</div>

I just found another question: [Package Aliases?](https://discourse.julialang.org/t/package-aliases/29334).

They introduce [`ImportMacros.jl`](https://github.com/fredrikekre/ImportMacros.jl) there.

I guess what I need to do is

```julia
module AVeryLongNamespace
using ImportMacros
@import AVeryLongNamespaceBase as ABase
@import AVeryLongNamespaceParsers as Parsers

export ABase, Parsers
end

```

It is good that [`ImportMacros.jl`](https://github.com/fredrikekre/ImportMacros.jl) create aliases of sub-packages, but it does not have the function of `Reexport`: reexporting symbols.

```julia
julia> using AVeryLongNamespace

julia> names(AVeryLongNamespace)
3-element Array{Symbol,1}:
 :ABase
 :Parsers
 :AVeryLongNamespace

```

However, when using `Reexport`, it also brings sub-packages into scope:

```julia
module AVeryLongNamespace
using Reexport
@reexport AVeryLongNamespaceBase
@reexport AVeryLongNamespaceParsers
end

```

```julia
julia> using AVeryLongNamespace

julia> names(AVeryLongNamespace)
5-element Array{Symbol,1}:
:something
:anotherthing
:AVeryLongNamespace
:AVeryLongNamespaceBase
:AVeryLongNamespaceParsers

```

Can I take the advatanges of both packages to let `names(AVeryLongNamespace)` to be

```julia
julia> names(AVeryLongNamespace)
5-element Array{Symbol,1}:
:something
:anotherthing
:AVeryLongNamespace
:Base
:Parsers

```

I understand it might be tricky to do this, but I just want to know is there any possibility.

---

_[View the full topic](https://discourse.julialang.org/t/is-julia-able-to-export-a-module-as-another-aliased-name/30814)._
