Is there some way to import ..
from a package using as
?
julia> using EllipsisNotation: .. as foo
ERROR: syntax: extra token "foo" after end of expression
Stacktrace:
[1] top-level scope
@ none:1
julia> using EllipsisNotation: :.. as foo
ERROR: syntax: invalid "using" statement: expected identifier
Stacktrace:
[1] top-level scope
@ none:1
julia> using EllipsisNotation: :(..) as foo
ERROR: syntax: invalid "using" statement: expected identifier
Stacktrace:
[1] top-level scope
@ none:1
The problem seems to be that the dots have a special meaning when parsed in using
:
julia> :(using EllipsisNotation: .. as)
:(using EllipsisNotation: ..as)
I can manually construct the expression I want, although it’s interesting that its printed representation is not syntactically valid:
julia> expr = :(using EllipsisNotation: XYZ as foo)
:(using EllipsisNotation: XYZ as foo)
julia> expr.args[1].args[2].args[1].args[1] = :..
:..
julia> expr
:(using EllipsisNotation: .. as foo)
I guess I could do eval(expr)
, but is there a proper a way to write this?