Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!uwm.edu!uakari.primate.wisc.edu!aplcen!haven!adm!smoke!gwyn From: gwyn@smoke.BRL.MIL (Doug Gwyn) Newsgroups: comp.lang.c Subject: Re: C history question Keywords: C design, XOR Message-ID: <11029@smoke.BRL.MIL> Date: 12 Sep 89 03:01:50 GMT References: <575@calmasd.Prime.COM> Reply-To: gwyn@brl.arpa (Doug Gwyn) Organization: Ballistic Research Lab (BRL), APG, MD. Lines: 18 In article <575@calmasd.Prime.COM> wlp@calmasd.Prime.COM (Walter Peterson) writes: >C has bitwise operators for AND (&), OR (|) and XOR (^) and boolean >operator for AND (&&) and OR (||), but not for XOR (^^). Why? >What happened to the boolean XOR operator ? If && makes sense for the >boolean AND and || makes sense for the boolean OR, why doesn't ^^ make >sense for the boolean XOR ? There is no need for ^^. The only reason for && and || is for the short- circuit property, which obviously ^^ could not have. For Boolean values a and b, a!=b is equivalent to a^^b and takes no more characters to code, besides being more readble for most people. For arbitrary values a and b (which I do NOT recommend in Boolean contexts), !a!=!b is one of many equivalent ways to express a^^b. >Is there any chance that some future version of ANSI-C will have it ? I hope not.