Path: utzoo!utgpu!watserv1!watmath!att!pacbell!pacbell.com!ucsd!sdd.hp.com!zaphod.mps.ohio-state.edu!wuarchive!mit-eddie!bloom-beacon!eru!hagbard!sunic!mcsun!hp4nl!eurtrx!euraiv1!reino From: reino@cs.eur.nl (Reino de Boer) Newsgroups: comp.lang.c Subject: Re: TRUE and FALSE Message-ID: <1990Aug31.145853.6125@cs.eur.nl> Date: 31 Aug 90 14:58:53 GMT References: <11215@alice.UUCP> <514@demott.COM> <2316@cirrusl.UUCP> <3835@sactoh0.SAC.CA.US> <26280@mimsy.umd.edu> <11474@crdgw1.crd.ge.com> Organization: Erasmus Universiteit Rotterdam, dept. CS (Informatica) Lines: 27 volpe@underdog.crd.ge.com (Christopher R Volpe) writes: >I wouldn't use TRUE and FALSE in comparisons such as if (x==TRUE) >for the reasons Chris Torek outlined, but I think they are useful >for setting default values, e.g. "int expert_mode = TRUE;". >For tests, if you want the extra clarity, how about the following: >#define TRUE(x) (x) >#define FALSE(x) (!(x)) >and then do things like " if (FALSE((x==y) && (x==z)) || whatever) ..." or, how about: #define FALSE 0 #define TRUE 1 #define BOOL( b ) ( (b) ? TRUE : FALSE ) #define NOT( b ) BOOL( !(b) ) so that NOT( TRUE ) == FALSE holds. -- Reino -- Reino R. A. de Boer "We want to build the right product right, right?" Erasmus University Rotterdam ( Informatica ) e-mail: reino@cs.eur.nl