digitalmars.D - Suggestion: Xor Comparison Operator
- Nick Sabalausky (3/3) Jul 03 2008 Pretty much just as the subject says. It's rare and far from major, but ...
- Gregor Richards (3/8) Jul 03 2008 != is xor, genius.
- Nick Sabalausky (6/12) Jul 03 2008 Heh, oh yea :)
- superdan (2/10) Jul 03 2008 and <= is implication btw. but it does exhaustive evaluation unfortunate...
Pretty much just as the subject says. It's rare and far from major, but I've come across a few places where it would be nice to be able to say "if(A ^^ B)" instead of "if(A && !B || !A && B)".
Jul 03 2008
Nick Sabalausky wrote:Pretty much just as the subject says. It's rare and far from major, but I've come across a few places where it would be nice to be able to say "if(A ^^ B)" instead of "if(A && !B || !A && B)".!= is xor, genius. - Gregor Richards
Jul 03 2008
"Gregor Richards" <Richards codu.org> wrote in message news:486DA24F.3090706 codu.org...Nick Sabalausky wrote:Heh, oh yea :) if((x == 1) != (y != 2)) No reason for that not to work. Too tired today :)Pretty much just as the subject says. It's rare and far from major, but I've come across a few places where it would be nice to be able to say "if(A ^^ B)" instead of "if(A && !B || !A && B)".!= is xor, genius. - Gregor Richards
Jul 03 2008
Gregor Richards Wrote:Nick Sabalausky wrote:and <= is implication btw. but it does exhaustive evaluation unfortunately.Pretty much just as the subject says. It's rare and far from major, but I've come across a few places where it would be nice to be able to say "if(A ^^ B)" instead of "if(A && !B || !A && B)".!= is xor, genius.
Jul 03 2008