Time to standardize "true" and "false"

Joe English jeenglis at nunki.usc.edu
Fri Sep 29 03:35:59 AEST 1989


pl at etana.tut.fi (Lehtinen Pertti) writes:
>From article <12070 at cit-vax.Caltech.Edu>, by wen-king at cit-vax.Caltech.Edu (King Su):
>> #define bool(a) (!!(a))
>> 
>> Then just use bool(X) whenever you wanted to use (bool)X.
>	Then suddenly just behind the corner cames C-compiler from
>	ACME-corporation and realizes '!!a' -> negation of negation is
>	same as original -> we can optimize it away.

But that won't happen with a working compiler, since
!!a is not equivalent to a.

This macro doesn't solve the perceived problem,
though:  what is wanted is a first-class boolean type
(don't ask me what it was wanted *for*, I don't
know...) This solution requires explicit casting of
every boolean expression.

--Joe English

  jeenglis at nunki.usc.edu.



More information about the Comp.lang.c mailing list