C Style

00704a-Liber nevin1 at ihlpf.ATT.COM
Wed Apr 27 09:43:44 AEST 1988


In article <3592 at haddock.ISC.COM> karl at haddock.ima.isc.com (Karl Heuer) writes:

>I think a more important reason is that the boolean operators such as "<" and
>"&&" are already guaranteed to return normalized boolean values (i.e. truth is
>denoted by 1).  Requiring the isXXX functions to do likewise would follow the
>principle of least astonishment.

This is a matter of opinion.  Personally, I would rather have the isXXX
macros be required to return their argument if true, since this conveys
more useful information than simplay a TRUE (1) or FALSE (0) value (BTW,
this might not be possible with the isascii macro).

Also, I would rather have all bits set to represent TRUE (such as two's
complement for -1) instead of 1, since I can use the bitwise operators on
boolean values most effectively this way (I'm not expecting this to happen
due to prior art with < and &&, but one can hope).
-- 
 _ __			NEVIN J. LIBER	..!ihnp4!ihlpf!nevin1	(312) 510-6194
' )  )				"The secret compartment of my ring I fill
 /  / _ , __o  ____		 with an Underdog super-energy pill."
/  (_</_\/ <__/ / <_	These are solely MY opinions, not AT&T's, blah blah blah



More information about the Comp.lang.c mailing list