Path: utzoo!utgpu!watmath!clyde!ima!haddock!karl From: karl@haddock.ima.isc.com (Karl Heuer) Newsgroups: comp.lang.c Subject: Re: Definition of boolean type Message-ID: <11731@haddock.ima.isc.com> Date: 10 Feb 89 20:22:37 GMT References: <10@dbase.UUCP> <9609@smoke.BRL.MIL> <3645@arcturus> Reply-To: karl@haddock.ima.isc.com (Karl Heuer) Organization: Interactive Systems, Boston Lines: 29 In article <3645@arcturus> evil@arcturus.UUCP (Wade Guthrie) writes: >>In article <10@dbase.UUCP> awd@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@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.