Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!wuarchive!gem.mps.ohio-state.edu!ginosko!usc!ucla-cs!math.ucla.edu!sonia!pmontgom From: pmontgom@sonia.math.ucla.edu (Peter Montgomery) Newsgroups: comp.lang.c Subject: Re: C history question Keywords: C design, XOR Message-ID: <1687@sunset.MATH.UCLA.EDU> Date: 12 Sep 89 21:34:36 GMT References: <575@calmasd.Prime.COM> Sender: news@MATH.UCLA.EDU Reply-To: pmontgom@math.ucla.edu (Peter Montgomery) Organization: UCLA Mathematics Department Lines: 22 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 ? I ask why C lacks &&= and ||=. In FORTRAN, I often write code like allok = allok .and. a(i).gt.b(i) C will let me write allok = allok && a[i] > b[i]; but it seems in the language spirit to avoid repeating "allok"; shouldn't we be allowed to abbreviate this to allok &&= a[i] > b[i]; -------- Peter Montgomery pmontgom@MATH.UCLA.EDU