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

Ambiguous parse for 1.+2 #7730

Closed
John-Jumper opened this issue Jul 26, 2014 · 2 comments
Closed

Ambiguous parse for 1.+2 #7730

John-Jumper opened this issue Jul 26, 2014 · 2 comments

Comments

@John-Jumper
Copy link

The expression 1.+2 produces 3::Int64 since the expression is parsed as (1) .+ (2) instead of (1.)+(2). It is very surprising (at least to me) that in the .+ operator has higher precedence than the floating literal in the lexer. It also means that 1.+2 gives a different value than 2+1., which is surprising to me.

I am learning Julia, so please disregard if this is an intentional or well-documented decision.

@IainNZ
Copy link
Member

IainNZ commented Jul 26, 2014

Somewhat related: #3777

@JeffBezanson
Copy link
Member

duplicate of #5246. There's a lot of discussion about this in that issue.

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