-
-
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
∧ and ∨ as aliases for && and || #17472
Comments
Note that these are totally different from other unicode alias since these are not functions at all. |
These symbols are standard notation for meets and joins. Short circuit boolean-only behavior would be terrible. |
Giving them non-short-circuiting behaviour, which can be implemented as a function makes some sense. That way they can still be overloaded as functions, so they can be redefined for other uses like Join and Meet and External Product |
I see the problems with this, as indicated by @yuyichao and @TotalVerb. However, I like the idea of @oxinabox. |
Just to pitch in, another use-case which stands against this is the definition of the wedge product of differential forms. |
I would also be against aliasing these to bitwise operations. I don't see how defining them on integers is a good idea. However, perhaps a definition for |
Since these are not just normal functions but control flow operators, I think that introducing alternate forms for them would be a very bad idea. For really basic language constructs like control flow you don't want too much diversity in how to spell things. Providing aliases for functions is a much different matter. |
I agree with @StefanKarpinski. But they could be a function, specialized for
In this case (and for any collection of |
@andyferris Such a definition is what I meant. I think that meaning would be uncontroversial. |
Doesn't look like much more discussion is warranted here. See #19788 for something that at least has a chance of happening. |
Allow use of unicode symbols
∧
and∨
as aliases for&&
and||
, respectively.This is in line with existing unicode aliases, such as:
≤
=<=
≥
=>=
≠
=!=
∈
=in
⊆
=issubset
Furthermore, I suggest
¬
as alias for!
.The purpose of these aliases is, of course, to allow use of standard mathematical/logical symbols, hence also making the code more readable.
(Note that this is not related to #5238. I am strictly talking about aliases, not replacing or removing anything, nor changing any precedences.)
The text was updated successfully, but these errors were encountered: