Path: utzoo!mnetor!uunet!husc6!mailrus!ames!necntc!ima!haddock!karl From: karl@haddock.ISC.COM (Karl Heuer) Newsgroups: comp.lang.c Subject: Re: C Style Message-ID: <3592@haddock.ISC.COM> Date: 24 Apr 88 21:47:40 GMT References: <11216@brl-adm.ARPA> <2111@chinet.UUCP> <4403@garfield.UUCP> <226@hotlr.ATT> <130@obie.UUCP> <5981@utcsri.UUCP> <1982@ubc-cs.UUCP> <126@atpal.UUCP> <2823@mmintl.UUCP> <255@oink.UUCP> <3583@haddock.ISC.COM> <20126@think.UUCP> Reply-To: karl@haddock.ima.isc.com (Karl Heuer) Organization: Interactive Systems, Boston Lines: 16 In article <20126@think.UUCP> barmar@fafnir.think.com.UUCP (Barry Margolin) writes: >Nowhere does the C language specify that any particular non-zero value >should be returned by the isXXX functions to indicate truth. This is correct according to historical precedent and the Jan88 dpANS. I disapprove nevertheless. >I can think of one reason, however, why 1 should be used as a standard >truth value. Single-bit fields ... 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. Karl W. Z. Heuer (ima!haddock!karl or karl@haddock.isc.com), The Walking Lint