I just found another question: Package Aliases?.
They introduce ImportMacros.jl
there.
I guess what I need to do is
module AVeryLongNamespace
using ImportMacros
@import AVeryLongNamespaceBase as ABase
@import AVeryLongNamespaceParsers as Parsers
export ABase, Parsers
end
It is good that ImportMacros.jl
create aliases of sub-packages, but it does not have the function of Reexport
: reexporting symbols.
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:
module AVeryLongNamespace
using Reexport
@reexport AVeryLongNamespaceBase
@reexport AVeryLongNamespaceParsers
end
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> 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.