-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
[parsing] is "++" an identifier or not ? #42076
Comments
The same tests pass for Depending on precedence, sometime the parsing relative to other infix operators will not be the same as for identifiers: |
|
Thanks for your answers and sorry for the delay in mine, i currently works on two jobs those days. It's sometime tought to catch everything on time. isidentifier doc needs an update
One may need to update doc for Base.isidentifier. Here is the doc for of v1.6
-- and ++ need to be not so differentOne may be clearer about the diff between
|
Note that Julia is not accepting fundamental language changes anymore, so we aren't really going to debate fundamental features like the ability to assign operators to arbitrary expressions. Reassignment of a constant is forbidden in the module that defines it (as in the case of your |
(I added the "doc" tag to this issue because it is really about improving the documentation for |
You 're right, thanks for pointing out correctly this case using Test
@test (+ = 1; +) == 1
@test (sin = 1; sin) == 1
@test_throws ErrorException Base.sin = 1
@test_throws ErrorException Base.:(+) = 1 It's a feature, not an error :) |
Thanks, Considering the boundary and similarity between id and op, I remain a bit puzzled by some changes at https://github.com/JuliaLang/julia/blob/v1.6.2/test/syntax.jl#L1945 introduced by #33158 @test Meta.parse("import Base.Foo.:(==).bar") == :(import Base.Foo.==.bar) IMHO operator should be atomical eg. do not be able to handle a getfield request May also concern #37583 afterwards isoperator may accept more than symbol |
are "++", ".." valid identifiers or not ?
FOR "++"
FOR ".."
BTW, "--" seems to throws on assign coherently with
Edited: add the ".." case
The text was updated successfully, but these errors were encountered: