Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!husc6!cmcl2!kramden.acf.nyu.edu!brnstnd From: brnstnd@kramden.acf.nyu.edu (Dan Bernstein) Newsgroups: comp.lang.c Subject: Re: TRUE and FALSE Message-ID: <7563:Sep622:49:1690@kramden.acf.nyu.edu> Date: 6 Sep 90 22:49:16 GMT References: <5398@harrier.ukc.ac.uk> <23970:Sep505:16:2390@kramden.acf.nyu.edu> <1308@mts.ucs.UAlberta.CA> Organization: IR Lines: 25 In article <1308@mts.ucs.UAlberta.CA> userAKDU@mts.ucs.UAlberta.CA (Al Dunbar) writes: > 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. [ I point out how you can enforce this with syntax, if you're desperate ] > ARGH! the "is_true" is understood, and redundant ! Even if you were right, that would be irrelevant ! The point of this discussion is to please Pascal programmers. Once again, the following should satisfy them: typedef struct { int truth; } truefalse; #define set_true(b) ((void) ((b)->true = 1)) #define set_false(b) ((void) ((b)->true = 0)) #define is_true(b) ((b).true) Usage: truefalse flagfoo; set_true(&flagfoo); if (is_true(flagfoo)) ... Notice that if (flagfoo) is illegal, and there is no possible problem along the lines of if (flagfoo == TRUE). Unless I'm mistaken, this is what the Pascalites are looking for. (Isn't it?) ---Dan