Path: utzoo!attcan!uunet!cs.utexas.edu!rutgers!cmcl2!adm!smoke!gwyn From: gwyn@smoke.BRL.MIL (Doug Gwyn) Newsgroups: comp.lang.c Subject: Re: Problem with ()?():() as ending test in for-loop Message-ID: <10328@smoke.BRL.MIL> Date: 26 May 89 17:19:00 GMT References: <17722@mimsy.UUCP> <344.nlhp3@oracle.nl> <17757@mimsy.UUCP> Reply-To: gwyn@brl.arpa (Doug Gwyn) Organization: Ballistic Research Lab (BRL), APG, MD. Lines: 10 In article <17757@mimsy.UUCP> chris@mimsy.UUCP (Chris Torek) writes: >But e1?e2:e3 *can* be turned into (e1&&e2 || !e1&&e3) Not always; that may evaluate e1 more than once, which matters if e1 has side effects. Also, the value of e1?e2:e3 is an appropriately promoted value of e2 or e3, whereas the value of (e1&&e2||!e1&&e3) is either 0 or 1. Just a warning against taking this discussion too literally..