Logical XOR (^^) operator
Currently we have bitwise
& and logical
&&, and bitwise
| and logical
||. Would it be possible to have logical
^^ in addition to the bitwise
^ for XOR?
Updated by mrkn (Kenta Murata) over 1 year ago
You can write
expr1 ^^ expr2 as
!expr1 != !expr2 in the current Ruby.
expr2 are boolean, you can write
expr1 != expr2.
^^ can be useful for the case that both
expr2 are not boolean.
Have you ever write such conditional expressions?