This may not work in v"1.10", got a warning on name conflicts.
julia> module Foo
x = 1
y = 2
for n in names(@__MODULE__; all=true)
if Base.isidentifier(n) && n ∉ (Symbol(@__MODULE__), :eval, :include)
@eval export $n
end
end
end
Main.Foo
julia> using .Foo
julia> x
1
julia> module Foo
x = 1000000
y = 2
for n in names(@__MODULE__; all=true)
if Base.isidentifier(n) && n ∉ (Symbol(@__MODULE__), :eval, :include)
@eval export $n
end
end
end
WARNING: replacing module Foo.
Main.Foo
julia> using .Foo
WARNING: using Foo.x in module Main conflicts with an existing identifier.
julia> x
1