# Syntax error with \`using EllipsisNotation: .. as foo\`

**URL:** <https://discourse.julialang.org/t/syntax-error-with-using-ellipsisnotation-as-foo/96464>\
**Category:** General Usage\
**Tags:** question, syntax\
**Created:** [March 22, 2023, 5:08pm UTC](https://discourse.julialang.org/t/syntax-error-with-using-ellipsisnotation-as-foo/96464 "2023-03-22T17:08:51Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![lmtzx9h4qqnt](https://avatars.discourse-cdn.com/v4/letter/l/74df32/32.png) [@lmtzx9h4qqnt](https://discourse.julialang.org/u/lmtzx9h4qqnt)\
**Post date:** [March 22, 2023, 5:08pm UTC](https://discourse.julialang.org/t/syntax-error-with-using-ellipsisnotation-as-foo/96464/1 "2023-03-22T17:08:51Z")

</div>

Is there some way to import `..` from a package using `as`?

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

---

<div class="post-metadata">

**Author:** ![ChrisRackauckas](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/chrisrackauckas/32/77_2.png) [@ChrisRackauckas](https://discourse.julialang.org/u/ChrisRackauckas)\
**Post date:** [March 22, 2023, 5:20pm UTC](https://discourse.julialang.org/t/syntax-error-with-using-ellipsisnotation-as-foo/96464/2 "2023-03-22T17:20:14Z")

</div>

`const foo = EllipsisNotation.:(..)` after `import EllipsisNotation` might do it?

---

<div class="post-metadata">

**Author:** ![lmtzx9h4qqnt](https://avatars.discourse-cdn.com/v4/letter/l/74df32/32.png) [@lmtzx9h4qqnt](https://discourse.julialang.org/u/lmtzx9h4qqnt)\
**Post date:** [March 22, 2023, 5:56pm UTC](https://discourse.julialang.org/t/syntax-error-with-using-ellipsisnotation-as-foo/96464/3 "2023-03-22T17:56:30Z")

</div>

Hm, I guess that should have the same effect. I was mostly asking out of curiosity, and thinking from a language point of view that there should be a way to use the syntax for all valid identifiers.

---

<div class="post-metadata">

**Author:** ![ChrisRackauckas](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/chrisrackauckas/32/77_2.png) [@ChrisRackauckas](https://discourse.julialang.org/u/ChrisRackauckas)\
**Post date:** [March 22, 2023, 6:02pm UTC](https://discourse.julialang.org/t/syntax-error-with-using-ellipsisnotation-as-foo/96464/4 "2023-03-22T18:02:13Z")

</div>

It does seem like you found a parser bug that’s worth reporting.

---

<div class="post-metadata">

**Author:** ![lmtzx9h4qqnt](https://avatars.discourse-cdn.com/v4/letter/l/74df32/32.png) [@lmtzx9h4qqnt](https://discourse.julialang.org/u/lmtzx9h4qqnt)\
**Post date:** [March 22, 2023, 6:18pm UTC](https://discourse.julialang.org/t/syntax-error-with-using-ellipsisnotation-as-foo/96464/5 "2023-03-22T18:18:29Z")

</div>

Opened [#49108](https://github.com/JuliaLang/julia/issues/49108)!
