Mutually Exclusive OR Operators. #9053
Unanswered
Thor110
asked this question in
Language Ideas
Replies: 3 comments 22 replies
This comment has been hidden.
This comment has been hidden.
-
Personally, using XOR when dealing with booleans is already difficult enough. Assuming |
Beta Was this translation helpful? Give feedback.
17 replies
-
IIRC VB had an operator called Imp or something for one of these. 3 seconds Google says that wasn't ported to VB.net, probably because no one used it. |
Beta Was this translation helpful? Give feedback.
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
This proposal introduces two new operators, XORA (^<) and XORB (^>), which would provide developers with a way to utilize the existing functionality of the XOR operator while explicitly stating whether the conditions are mutually exclusive.
For example:
if (!A && B)
else if (A && !B)
Could be written as:
if (A ^< B)
else if(A ^ B)
It's worth noting that the use of the XOR operator would naturally follow the use of the XORA or XORB operator.
Beta Was this translation helpful? Give feedback.
All reactions