Xref: utzoo comp.lang.c:31683 alt.lang.cfutures:49 Path: utzoo!utgpu!cs.utexas.edu!swrinde!zaphod.mps.ohio-state.edu!ncar!umigw!umiami!mthvax!ziggy!screamer!tscs!tct!chip From: chip@tct.uucp (Chip Salzenberg) Newsgroups: comp.lang.c,alt.lang.cfutures Subject: Re: TRUE and FALSE Message-ID: <26E7ADAA.3EC@tct.uucp> Date: 7 Sep 90 14:24:41 GMT References: <5398@harrier.ukc.ac.uk> <3686@goanna.cs.rmit.oz.au> <1990Sep6.113259.2109@ifi.uio.no> Followup-To: alt.lang.cfutures Organization: Teltronics/TCT, Sarasota, FL Lines: 25 According to joare@sdata.no: > return f() || g(); Perl also has the LISP meaning for this operation. This C equivalent is too verbose: > a = f(); > if (a) > return a; > else > return g(); Try instead: return (a = f()) ? a : g(); Note that GNU CC has a ?: operator where the second operand defaults to the value of the first operand. So with GNU CC, you can write: return f() ?: g(); Followups to alt.lang.cfutures. -- Chip Salzenberg at Teltronics/TCT ,