-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
allow function definitions with operators that use comparison syntax
- Loading branch information
1 parent
f576e87
commit f07485f
Showing
2 changed files
with
30 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
f07485f
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.
New syntax without any discussion or review?
We don't allow this for any other infix operators, why just comparisons?edit: oh, we do. When did that happen?f07485f
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.
Why sometimes things go into Julia without peer review as Tony mentions? When is it safe for the repo owners to commit directly? Everything being peer reviewed is the correct thing am I right?
Whenever I make a PR I'm always asked to change the docs and add tests for those changes. So in this case we would also need to add a change to the documentation acordingly in order to include this feature.
f07485f
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.
I had no idea infix function definition syntax was allowed, so it's certainly underdocumented (#15483)
f07485f
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 is not new syntax. We have always supported definitions with infix syntax, and missing the case of comparison operators was a bug due to their slightly different parsing. Such a trivial matter. Honestly.
f07485f
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.
I don't think I've ever seen docs, examples, tests, or code in packages that used infix definition syntax. That's why this surprised me. If the only evidence of it working is in
julia-syntax.scm
, then it's pretty much a hidden feature.f07485f
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.
The definition and usage have always been parsed the same, but it is definitely an undocumented feature.