Path: utzoo!attcan!uunet!van-bc!ubc-cs!alberta!mts.ucs.UAlberta.CA!Al_Dunbar From: userAKDU@mts.ucs.UAlberta.CA (Al Dunbar) Newsgroups: comp.lang.c Subject: Re: more on TRUE and FALSE (side-comment) Message-ID: <1389@mts.ucs.UAlberta.CA> Date: 29 Sep 90 15:30:38 GMT References: <9@christmas.UUCP> <4673@tuminfo1.lan.informatik.tu-muenchen.dbp.de> Organization: MTS Univ of Alberta Lines: 32 In article <4673@tuminfo1.lan.informatik.tu-muenchen.dbp.de>, weiske@lan.informatik.tu-muenchen.dbp.de (Thomas Weiske) writes: >I use some very useful header files because I cant remember >the actual encoding of TRUE/FALSE. Actually I cant remember >the correct writing of True or False, sometimes I prefer >true and false depending on the context to get a nice C >Program Layout. >Here is the first one: >---x---x---x---x---x---x---x---x---x---x--- >#define TRUE ((0)==(0)) >#define True TRUE >#define true True >#define FALSE ((1)==(2)) >#define False FALSE >#define false False >---x---x---x---x---x---x---x---x---x---x--- >To make the definitions more tolerant to typos >you can add >'Treu' or 'Fasle' a.s.o. >The interesting thing is the compatibility to >all in this newsgroup suggested encodings of >TRUE and FALSE without any loss of runtime speed! > an interesting concept! You could also define FOUR, FORE, and FOYER (in various combinations of upper/lower case) as 'for', just in case one day you forgot how to spell 'for'. That would certainly give you a nice "program layout". -------------------+------------------------------------------- Al Dunbar | Edmonton, Alberta | this space for rent CANADA | -------------------+------------------------------------------- #! r