Path: utzoo!mnetor!uunet!lll-winken!lll-tis!ames!pacbell!att-ih!ihnp4!ihlpf!nevin1 From: nevin1@ihlpf.ATT.COM (00704a-Liber) Newsgroups: comp.lang.c Subject: Re: C Style Message-ID: <4547@ihlpf.ATT.COM> Date: 26 Apr 88 23:58:53 GMT References: <11216@brl-adm.ARPA> <2111@chinet.UUCP> <4403@garfield.UUCP> <20126@think.UUCP> <601@vsi.UUCP> <364@m3.mfci.UUCP> Reply-To: nevin1@ihlpf.UUCP (00704a-Liber,N.J.) Organization: AT&T Bell Laboratories - Naperville, Illinois Lines: 29 In article <364@m3.mfci.UUCP> karzes@mfci.UUCP (Tom Karzes) writes: >TRUE should have the same type and value as the constant expression (0 == 0). >Similarly, FALSE should have the same type and value as the constant >expression (0 != 0). This principle holds for any language. In the case >of C, TRUE and FALSE are signed 1 and signed 0, resp. Since when does this principle hold for any language?? Take Fortran, for instance. If I remember correctly, odd numbers were TRUE and even numbers were FALSE (or vice-versa; it's really been a long time since I used FORTRAN), since compilers were required to look at only the least significant bit when checking for true/false values. (This may have been changed for F77; I'm not sure.) There are many other examples I could cite (Icon, LISP, etc.). Your principle only holds for languages which a) Have a boolean type and b) All logical operations result in that boolean type such as Pascal. Many (most?) languages do not conform to these requirements. -- _ __ NEVIN J. LIBER ..!ihnp4!ihlpf!nevin1 (312) 510-6194 ' ) ) "The secret compartment of my ring I fill / / _ , __o ____ with an Underdog super-energy pill." / (_