Path: utzoo!attcan!utgpu!jarvis.csri.toronto.edu!mailrus!uwm.edu!uakari.primate.wisc.edu!aplcen!ginosko!uunet!sdrc!scjones From: scjones@sdrc.UUCP (Larry Jones) Newsgroups: comp.lang.c Subject: Re: precedence of ?: (was: precedence of && (was: precedence of ?:)) Message-ID: <803@sdrc.UUCP> Date: 16 Sep 89 20:17:20 GMT References: <1265@gmdzi.UUCP> <11030@smoke.BRL.MIL> <11039@smoke.BRL.MIL> <11069@smoke.BRL.MIL> Organization: Structural Dynamics Research Corp., Cincinnati Lines: 18 In article <11069@smoke.BRL.MIL>, gwyn@smoke.BRL.MIL (Doug Gwyn) writes: > So the interesting question becomes, why is that "expression" for the > second operand of ?: and not "logical-OR-expression". (I think that > "conditional-expression" might result in ambiguity.) The Rationale > says merely that "several extant implementations have adopted this > practice". That must be the answer.. The answer is that the "?" and ":" are paired delimiters, just like parentheses. That means that you can put any arbitrary expression between them without creating any ambiguity just like you can put any arbitrary expression between "(" and ")". ---- 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 "I have plenty of good sense. I just choose to ignore it." -Calvin