Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Confusing deprecation warning #10896

Closed
yuyichao opened this issue Apr 19, 2015 · 5 comments
Closed

Confusing deprecation warning #10896

yuyichao opened this issue Apr 19, 2015 · 5 comments

Comments

@yuyichao
Copy link
Contributor

See below. Are {a,b, ...} or Any[a,b, ...] valid syntax ever?

julia> {1, (1, 2)...}
WARNING: deprecated syntax "{a,b, ...}".
Use "Any[a,b, ...]" instead.
julia> {1, (1, 2)...}

WARNING: deprecated syntax "{a,b, ...}".
Use "Any[a,b, ...]" instead.
3-element Array{Any,1}:
 1
 1
 2

julia> {1, (1, 2), ...}
WARNING: deprecated syntax "{a,b, ...}".
Use "Any[a,b, ...]" instead.
julia> {1, (1, 2), ...}

WARNING: deprecated syntax "{a,b, ...}".
Use "Any[a,b, ...]" instead.
ERROR: UndefVarError: ... not defined

julia> Any[1, (1, 2), ...]
ERROR: UndefVarError: ... not defined
@kmsquire
Copy link
Member

The splat (...) is applied before the deprecation warning, so it's not actually part of the input (and therefore, the warning has nothing to do with the fact that you were splatting (1, 2). Try:

julia> Any[1, (1,2)...]
3-element Array{Any,1}:
 1
 1
 2

julia> [1, (1,2)...]
3-element Array{Int64,1}:
 1
 1
 2

@yuyichao
Copy link
Contributor Author

Oh, I see.

So the ... is actually not a operator and is just a place holder for any number of elements......

I guess I'm just unlucky to hit it with just the right form of input and confused about what it is talking about.....

@kmsquire
Copy link
Member

You got it!

@jiahao
Copy link
Member

jiahao commented Apr 19, 2015

#8593

@yuyichao
Copy link
Contributor Author

= = ..... Glad to see that I'm not the only one who is confused by the usage of ... in the document.......

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants