-
-
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
? behaves strangely as an identifier #6286
Comments
It's not supposed to be possible to define methods for |
Also note that |
I'm not able to reproduce any comment-related behavior in either master or 0.2. Could you provide some more details about what commit hash you're using (just paste the banner), and exactly how you're running the code --- what is in a file, what is typed at the REPL, etc. ? |
|
I ran it in both iJulia, and in the terminal julia. It fails in either case if there is no mention of
and it succeeds in iJulia if there's even a comment |
Those give me |
There was my suggested non-breaking fix of changing the parsing so that |
I think that will work. |
No. We use it sometimes in places (like ccall) which don't allow conditionals |
That can be changed. The current |
There are only two places in Base where that kind of thing is used in a macro: base/stream.jl
881-
882:dup(x::RawFD) = RawFD(ccall((@windows? :_dup : :dup),Int32,(Int32,),x.fd))
883-dup(src::RawFD,target::RawFD) = systemerror("dup",-1==
884: ccall((@windows? :_dup2 : :dup2),Int32,
885- (Int32,Int32),src.fd,target.fd)) Not exactly earth-shattering to work around. |
Ref: #1910 |
Closing as dupe of #22025 (even though this came first, the other issue seems to have more recent/productive discussion) |
* deprecate no space after the ? (no space before was already deprecated) * deprecate no space around the : * fix instances where no spaces were used in Base Deprecate the use of `?` as an identifier Ref #6286
* deprecate no space after the ? (no space before was already deprecated) * deprecate no space around the : * fix instances where no spaces were used in Base Deprecate the use of `?` as an identifier Ref JuliaLang#6286
I have a composite type which has a single Dict property that I thought would be interesting to access with an overloaded ? operator
I found that I could only use my overloaded
?
operator if I mention it before hand, even with a comment. Otherwise it says that?
is not a generic function.The text was updated successfully, but these errors were encountered: