-
-
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
require space between <
and unary operators?
#25337
Comments
and maybe let DocumentFormat.jl do the work of enforcing on space or popup warnig? |
We have a lot of Unicode arrow operators now... do we really need another ascii-art “arrow”? |
I feel like this could lead to really hard to detect errors when writing things like |
FWIW Given our multitude of Unicode arrows and the ease with which we allow entering Unicode symbols at the REPL and in editors, it seems unnecessary to me to add little gotchas in the parser just for the sake of having a couple of cute ASCII operators. |
Interesting, there are still more Unicode arrows we need to add, in particular ⇜ and ⇝. |
See also #23224. The elements of the Arrows block that are currently not parsed as operators are |
+1 for operator-izing |
The left and right arrows are easy enough, the up and down ones need an appropriate precedence. We can always add more arrow operators in 1.x versions so this is not urgent. |
@StefanKarpinski, adding these arrow operators in 1.x would be a breaking change. e.g. |
I added several of those in #25360 |
I was under the impression that we were treating characters that we might want to make into operators (like arrows) as invalid. Of that not the case, should we do that? |
Yes, on master the whole arrows block was made invalid characters, some of which have now become operators. Identifying other characters that we might make into operators unfortunately has to be done one at a time in general. |
Right, sorry, I wasn't checking master. On master the remaining non-operator arrows are |
This would allow us to add
<-
and<~
as operators (see e.g. #16985 (comment)).x<-1
for comparingx
to-1
is arguably not good style.We could add
~>
now, which would only break applying bitwise not to the>
operator (which is pretty silly, although!>
is a different story :) ).The text was updated successfully, but these errors were encountered: