Time to standardize "true" and "false"

Jesse Furqueron wjf at attctc.Dallas.TX.US
Mon Sep 25 08:21:20 AEST 1989


In article <13730 at well.UUCP>, nagle at well.UUCP (John Nagle) writes:
> 
>      I would like to suggest that the time has come to standardize the
> Boolean values in C.  Most programs have definitions of these, but they
> differ and clash.  As the typing rules become ever tighter, and the number
	
			xyzzy!! and text disappears...

> 
>      I would suggest that the standardized definition be
>      If it's too late to fix this in C, it should be fixed in C++, where
> typing is taken more seriously.
> 
> 					John Nagle


I would suggest rather than FALSE = 0 and TRUE = 1, that the "real" definition
of TRUE is not FALSE (TRUE = not 0), i.e. TRUE = !0.  Therefore the following

#define FALSE	0
#define TRUE	!0 

or for c++ folks

const boolean (FALSE=0, TRUE=!0);

I believe (if this tired and aged memory serves me correctly) that somewhere
K&R refers to this being the evalutations used in if and while statements.


Jesse Furqueron
VISystems
11910 Greeneville Suite 300
LB 29
Dallas, Tx. 75243
(214) 907-8080

-------------------------------------------------------------------------------
As always, the opinions expressed by myself are not necessarily those of my
employer... maybe one of these days they'll learn to listen!!!
-------------------------------------------------------------------------------



More information about the Comp.lang.c mailing list