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

ERROR: syntax: extra token ".." after end of expression #5715

Closed
pygy opened this issue Feb 7, 2014 · 6 comments
Closed

ERROR: syntax: extra token ".." after end of expression #5715

pygy opened this issue Feb 7, 2014 · 6 comments
Labels
bug Indicates an unexpected problem or unintended behavior parser Language parsing and surface syntax

Comments

@pygy
Copy link
Contributor

pygy commented Feb 7, 2014

julia> ..(a,b) = b - a
.. (generic function with 1 method)

julia> 4 .. 6
2

julia> 4 .. 6 .. 7
ERROR: syntax: extra token ".." after end of expression

Maybe linked to the #2614 fix?

@JeffBezanson
Copy link
Sponsor Member

I'm not sure what the precedence or associativity of .. should be. If it's like ., it should have very high precedence.

@mschauer
Copy link
Contributor

mschauer commented Feb 8, 2014

People liked this operator in the past as variant of . which would imply high precedence or as some kind of range constructor : which would imply low precedence, hard to call.

@pygy
Copy link
Contributor Author

pygy commented May 4, 2015

FWIW it is really about more than one .. operator in a single expression:

julia> ..(a, b) = a * b
.. (generic function with 1 method)

julia> "a"*"b".."c"
"abc"

julia> "a".."b"*"c"
"abc"

julia> "a".."b"*"c".."d"
ERROR: syntax: extra token ".." after end of expression.

@JeffBezanson JeffBezanson added bug Indicates an unexpected problem or unintended behavior parser Language parsing and surface syntax labels May 4, 2015
@brenhinkeller
Copy link
Sponsor Contributor

So this one is still true in 1.8.3

julia> ..(a,b) = b - a
.. (generic function with 1 method)

julia> 4 .. 6
2

julia> 4 .. 6 .. 7

ERROR: syntax: extra token ".." after end of expression
Stacktrace:
 [1] top-level scope
   @ none:1

@mschauer
Copy link
Contributor

The consequence of being forced to be explicit (4 .. 6) .. 7 or 4 .. (6 .. 7) seems benign, one less associativity to be remembered.

@brenhinkeller
Copy link
Sponsor Contributor

Yeah, fair. It certainly doesn't seem to have been causing much trouble in the intervening years. I'll close as not planned then, but if folks disagree they should feel free to undo.

@brenhinkeller brenhinkeller closed this as not planned Won't fix, can't repro, duplicate, stale Nov 18, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Indicates an unexpected problem or unintended behavior parser Language parsing and surface syntax
Projects
None yet
Development

No branches or pull requests

4 participants