Xref: utzoo comp.lang.c++:4859 comp.lang.c:22357
Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!uwm.edu!uakari.primate.wisc.edu!ginosko!usc!merlin.usc.edu!nunki.usc.edu!jeenglis
From: jeenglis@nunki.usc.edu (Joe English)
Newsgroups: comp.lang.c++,comp.lang.c
Subject: Re: Time to standardize "true" and "false"
Message-ID: <5389@merlin.usc.edu>
Date: 28 Sep 89 17:35:59 GMT
References: <12070@cit-vax.Caltech.Edu> <8862@etana.tut.fi>
Sender: news@merlin.usc.edu
Reply-To: jeenglis@nunki.usc.edu (Joe English)
Followup-To: comp.lang.c++
Organization: University of Southern California, Los Angeles, CA
Lines: 21

pl@etana.tut.fi (Lehtinen Pertti) writes:
>From article <12070@cit-vax.Caltech.Edu>, by wen-king@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@nunki.usc.edu.