Path: utzoo!attcan!uunet!lll-winken!lll-tis!ames!husc6!spdcc!ima!haddock!karl
From: karl@haddock.ISC.COM (Karl Heuer)
Newsgroups: comp.std.c
Subject: Re: the logical xor operator!
Message-ID: <4752@haddock.ISC.COM>
Date: 24 Jun 88 23:29:00 GMT
References:  <1719@ogcvax.ogc.edu> <1309@ark.cs.vu.nl> <1310@ark.cs.vu.nl>
Reply-To: karl@haddock.ima.isc.com (Karl Heuer)
Organization: Interactive Systems, Boston
Lines: 16

In article <1310@ark.cs.vu.nl> maart@cs.vu.nl (Maarten Litmaath) writes:
>This time the question is: why hasn't C got a logical xor operator?

Since you posted the question to comp.std.c, I'll interpret the question as
"Why wasn't logical xor added to ANSI C?".  The answer is that it isn't useful
enough to be worth the change to the language.

>Of course the way to come around the deficiency is: [ !x != !y ]
>but this only works if !0 always evaluates to the same value (viz. 1),

Which it is and always has been.

Of course, if you're dealing with true boolean expressions (and I hold the
opinion that nothing else should be handed to a logical operator), then either
"x != y" or "x ^ y" will do.

Karl W. Z. Heuer (ima!haddock!karl or karl@haddock.isc.com), The Walking Lint