Path: utzoo!utgpu!news-server.csri.toronto.edu!rutgers!mit-eddie!uw-beaver!ubc-cs!alberta!mts.ucs.UAlberta.CA!Al_Dunbar From: userAKDU@mts.ucs.UAlberta.CA (Al Dunbar) Newsgroups: comp.lang.c Subject: Re: TRUE and FALSE Message-ID: <1308@mts.ucs.UAlberta.CA> Date: 6 Sep 90 02:05:46 GMT References: <5398@harrier.ukc.ac.uk> <23970:Sep505:16:2390@kramden.acf.nyu.edu> Organization: MTS Univ of Alberta Lines: 24 In article <23970:Sep505:16:2390@kramden.acf.nyu.edu>, brnstnd@kramden.acf.nyu.edu (Dan Bernstein) writes: >In article <5398@harrier.ukc.ac.uk> mtr@ukc.ac.uk (M.T.Russell) writes: >> To the people complaining about `if (x == TRUE)': YOU ONLY USE `TRUE' AND >> `FALSE' FOR ASSIGNMENT AND PARAMETER PASSING. It's a fairly simple rule. > >Usage: truefalse flagfoo; set_true(&flagfoo); if (is_true(flagfoo)) ... ARGH! the "is_true" is understood, and redundant ! 'if (flagfoo)' means 'if flagfoo is true', in the same way that the following two sentences mean (almost) exactly the same thing in English: 1) If it is raining you will get wet. 2) If it is true that it is raining you will get wet. The is_true() macro is almost as useful as a macro you might write to return the numeric value of its argument, i.e.: a = value_of( b ) + value_of( c ); -------------------+------------------------------------------- Al Dunbar | Edmonton, Alberta | this space for rent CANADA | -------------------+-------------------------------------------