the logical xor operator! (John F. Haugh II, Karl W. Z. Heuer)

Maarten Litmaath maart at cs.vu.nl
Tue Jun 28 11:07:35 AEST 1988


In article <3254 at rpp386.UUCP> jfh at rpp386.UUCP (The Beach Bum) writes:
\ps - your .signature is thought provoking.  i can't decide whether i'd
\     rather live in a large communist country which oppresses blacks
\     or a small capitalist country which oppresses blacks.  hard choice.

I CAN decide whether I'd rather live in a country in which maybe not all
people get on equally well, but at least are equal for the law, or a country
in which the law states there be an apartheid between black and white (very
smart solution to prevent the black majority from regaining the power and
wealth stolen from them)...

Now about the topic in the subject line.
Karl W. Z. Heuer writes:
>"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.

Well, it's strange K&R didn't think of it in the first place (don't give
me the story about shortcutting: that's no reason for not implementing ^^).
Furthermore, it can be implemented WITHOUT breaking existing code, and
(admittedly) sometimes one would wish for ^^; but then again: isn't Karl
having problems himself to get \c accepted by ANSI? :-)

ANSI committee: "Yes, it's kinda nice. Go back and do your homework properly!
		Come back to us if you've found something dubious, about which
		we can spend a week arguing!"

>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.

Come on Karl, what's so terrible about the following common practice?

	if (some_pointer && ...) {
		...
	}
-- 
I'd rather live in Russia             |Maarten Litmaath @ Free U Amsterdam:
              than in South-Africa... |maart at cs.vu.nl, mcvax!botter!ark!maart



More information about the Comp.std.c mailing list