Definition of boolean type

Karl Heuer karl at haddock.ima.isc.com
Sat Feb 11 06:22:37 AEST 1989


In article <3645 at arcturus> evil at arcturus.UUCP (Wade Guthrie) writes:
>>In article <10 at dbase.UUCP> awd at dbase.UUCP (Alastair Dallas) writes:
>>>But what about a boolean type?
>
>ack phht.  Many people have been programming in C for years and have
>gotten quite used to C's handling of boolean (translate: int) stuff 
>(I even like it).

The same could have been said of `void'% before it was added to C.  Just
because it's possible to do without it doesn't make it a bad idea.

>More importantly, any change to C to include a boolean type would make a lot
>of existing code break.

Nonsense.  I can easily come up with a model that is useful, yet completely
backward compatible with existing code (modulo the new keyword, and even that
can be avoided).

>The same thing can be done with commenting:
>	int	flag,	/* boolean: set if ... */

Adding it to the language would make the information available to the compiler
as well as the reader.  This would allow more errors to be caught at compile
time, and it could sometimes produce better code.

Karl W. Z. Heuer (ima!haddock!karl or karl at haddock.isc.com), The Walking Lint
________
% I'm sure there are some Neanderthals out there that still eschew `void'.
  You need not reply just to state your existence.



More information about the Comp.lang.c mailing list