Path: utzoo!mnetor!uunet!husc6!bloom-beacon!gatech!mcnc!rti!sas!bts From: bts@sas.UUCP (Brian T. Schellenberger) Newsgroups: comp.lang.c Subject: Re: C Style Message-ID: <477@sas.UUCP> Date: 25 Apr 88 02:10:38 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: bts@sas.UUCP (Brian T. Schellenberger) Organization: SAS Institute Inc, Cary NC Lines: 24 In article <20126@think.UUCP> barmar@fafnir.think.com.UUCP (Barry Margolin) writes: |[for one-bit bit fields] |it would be nice to be able to say flag = isXXX(...) rather |than flag = (isXXX(...) != FALSE). But this is just a wish; portable |code must currently use the more verbose version. (I will probably start a "if( a = b )"-type flame war for this, but): I prefer the shorter form: flag = !!isXXX(...) You can think of "!!" as the "truth-value-of" or "convert-to-canonical-boolean" operator. ( To forestall 10 "I didn't know there was such an operator" postings: ) ( This is "!" followed by "!": ) ( non-zero -> 0 -> 1 ) ( 0 -> 1 -> 0 ) -- --Brian. (Brian T. Schellenberger) ...!mcnc!rti!sas!bts . . . now at 2400 baud, so maybe I'll stop bothering to flame long includes.