Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.1 6/24/83; site decwrl.UUCP Path: utzoo!watmath!clyde!burl!ulysses!mhuxj!houxm!ihnp4!zehntel!dual!decwrl!dec-rhea!dec-jon!moroney From: moroney@jon.DEC Newsgroups: net.lang.c Subject: ^^, ====, and other kludges Message-ID: <204@decwrl.UUCP> Date: Tue, 11-Dec-84 11:42:30 EST Article-I.D.: decwrl.204 Posted: Tue Dec 11 11:42:30 1984 Date-Received: Thu, 13-Dec-84 03:26:35 EST Sender: daemon@decwrl.UUCP Organization: DEC Engineering Network Lines: 16 It seems to me that all this discussion about new operators such as ^^ is all caused by an oversight in the implementation of (actually lack of) booleans in C. If C had a strict rule that 0 is false, 1 is true and well, anything else, you take your chances, there would not be any need for any new operators like ^^. If the only legal value of TRUE is 1, ^^ evaluates the same as ^ in all cases, so ^^ would be unnecessary. Also, the only difference between && and & would be whether the second operation would always be evaluated or not. If the definition of ! were the same (!0==1, !anythingelse==0) then the old definition of non-zero =true could still be used by using !!x (or x!=0) which gives TRUE (or 1) if x!=0 and FALSE (0) if x==0. Also a one-bit new type (boolean or logical) could be created that used only 1 bit to determine TRUE or FALSE, allowing the use of huge arrays of booleans using little memory. (Admittedly not very common) "There's a madness to my method." Mike Moroney ..!decwrl!rhea!jon!moroney