Path: utzoo!attcan!uunet!snorkelwacker!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: <1306@mts.ucs.UAlberta.CA> Date: 5 Sep 90 01:11:05 GMT References: <5398@harrier.ukc.ac.uk> Organization: MTS Univ of Alberta Lines: 27 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. > Hear, hear!!! I would hazard a guess at this point that perhaps the reason that there is so much contention and misunderstanding here is simply that C doesn't have a 'LOGICAL' (or boolean) type. In certain contexts, an integral value is taken by the compiler to mean False if zero and True if non-zero. If you were forced to provide an expression of boolean type, then the compiler would quickly straighten everyone out, and 'if (x == TRUE)' would never appear in a compiled program. The struggle to make it look like it has a boolean type (such as the macros suggested recently, one of which expanded to over 200K bytes!!!) are not doing much to add clarity to the situation. Unfortunately, the solution is that we should all learn the language a little better. -------------------+------------------------------------------- Alastair Dunbar | Edmonton: a great place, but... Edmonton, Alberta | before Gretzky trade: "City of Champions" CANADA | after Gretzky trade: "City of Champignons" -------------------+-------------------------------------------