Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!watmath!clyde!burl!ulysses!mhuxr!mhuxn!ihnp4!bentley!kwh From: kwh@bentley.UUCP (KW Heuer) Newsgroups: net.lang.c Subject: Re: Boolean Operators Slighted in C Message-ID: <791@bentley.UUCP> Date: Mon, 5-May-86 09:37:54 EDT Article-I.D.: bentley.791 Posted: Mon May 5 09:37:54 1986 Date-Received: Wed, 7-May-86 01:29:55 EDT References: <778@bentley.UUCP> Organization: AT&T Bell Laboratories, Liberty Corner Lines: 17 In article <778@bentley.UUCP> I wrote: >A true boolean datatype would have a couple of advantages: > >o Multiple flag variables with local scope and no address operator (e.g. > variables declared "register bool") could be packed into a single word. > >o "++x" and "--x" could be defined as "set" and "clear"; "x++" and "x--" > would then be "test and (set|clear)". This would obviate such things as > "if (!flag) { flag=1; printmsg(); }". I forgot to mention one other: o A function returning a bool could be implemented on some machines by setting the condition codes instead of storing a full integer value in the return register. Karl W. Z. Heuer (ihnp4!bentley!kwh), The Walking Lint