Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!csd4.milw.wisc.edu!lll-winken!uunet!sdrc!scjones From: scjones@sdrc.UUCP (Larry Jones) Newsgroups: comp.lang.c Subject: Re: Problem with ()?():() as ending test in for-loop Message-ID: <732@sdrc.UUCP> Date: 25 May 89 21:48:08 GMT References: <1200@liszt.kulesat.uucp> <17722@mimsy.UUCP> Organization: Structural Dynamics Research Corp., Cincinnati Lines: 15 In article <17722@mimsy.UUCP>, chris@mimsy.UUCP (Chris Torek) writes: > Any valid `logical' [true/false] > e1?e2:e3 expression can always be transformed this way into (e1&&e2)||e3, > provided e3 has no side effects. Eh? If e1 and e3 are true while e2 is false, then e1?e2:e3 is false but (e1&&e2)||e3 is true. Seems to me you can't avoid having to do (e1&&e2)||(!e1&&e3). ---- Larry Jones UUCP: uunet!sdrc!scjones SDRC scjones@SDRC.UU.NET 2000 Eastman Dr. BIX: ltl Milford, OH 45150-2789 AT&T: (513) 576-2070 "You can't get a body like mine in a bottle -- unless you push REAL HARD." - Judy Tenuta / Dr. Pepper