-
-
Notifications
You must be signed in to change notification settings - Fork 5.7k
Improve documentation of operators #60286
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
Conversation
b39e988 to
d46161e
Compare
a68df3e to
f78985a
Compare
|
Given that the documentation previously said that a space was required in expressions like the |
|
hello @moble @stevengj I’ve been reading through the changes and I’m interested in contributing here as well. In particular, I’d like to help by adding a few concrete examples to clarify operator suffixes and chaining behavior, and double-checking that the precedence/associativity descriptions match actual Julia behavior. Let me know if you’d prefer examples in a specific section or if there are other gaps you’d like help filling. Happy to open a small follow-up commit if that’s useful. |
|
@Bhupendra-glitch Thanks! I'm hoping that this PR could be merged soon, so I think it makes more sense to open that as a separate PR. Feel free to ping me on it! @stevengj Does this look ready to go to you? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks a nice improvement, thanks a lot!
I've left a bunch of comments. Several are clearly "out of scope" in that they affect text that was there before your PR. These are not meant to block this PR, I just thought you might be able to address them, given that you already familiarized yourself with this. Of course that does not at all mean you have to, or have to do it in this PR.
The one change I care about is explaining the meaning of the parenthesis in the table before the table. Everything else is optional.
|
@fingolfin Thanks for your review. You raise good points. I've added a commit that addresses at least some of them, but I still have to go through each of your points to make sure I haven't missed any. I'll respond to them above (though I'm really busy for the rest of the day, so I might not get to everything today). |
- Add adjoint operator to the precedence table at correct precedence level between :: and exponentiation - Explain exceptions to exponentiation precedence - Include implicit multiplication by juxtaposition of numeric literals in precedence table - Include arrows in precedence table - Note that comparison operators can be chained with undefined evaluation order - Explain that operators can be used in both infix and functional notation - Note that new operators can be defined with suffixes, and show an example
Co-authored-by: Steven G. Johnson <[email protected]>
Co-authored-by: Steven G. Johnson <[email protected]>
Co-authored-by: Max Horn <[email protected]>
fingolfin
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Awesome!
I've always found the documentation of operators a little disjointed and incomplete; this PR aims to improve the situation.
::and before exponentiation||and?