Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10 5/3/83; site bbncca.ARPA Path: utzoo!linus!bbncca!keesan From: keesan@bbncca.ARPA (Morris Keesan) Newsgroups: net.lang.c Subject: Re: Precedence Question - (nf) Message-ID: <575@bbncca.ARPA> Date: Tue, 14-Feb-84 10:12:45 EST Article-I.D.: bbncca.575 Posted: Tue Feb 14 10:12:45 1984 Date-Received: Wed, 15-Feb-84 00:48:00 EST References: <59@haddock.UUCP> Organization: Bolt, Beranek and Newman, Cambridge, Ma. Lines: 33 ----------------------------- (Pardon the first attempt at this if I didn't manage to cancel it in time -- I've just moved to a new office, and my terminal connection is very flaky.) ----------------------------- A trivial quibble: John Levine (ima!johnl) says > In regard to this: > > cat = foo ? fu = bar : mouse; > > Precedence has nothing to do with it. and > The only possible parse for the first expression is: > > cat = foo ? (fu = bar) : mouse; ----- I agree that the original question posed by smu!pedz has nothing to do with precedence, but is an "order of evaluation" question. However, precedence does enter into the parsing of the expression, and it's exactly the precedence rule that Pedz was misapplying, the precedence of ?: over assignment, that makes the correct parse cat = (foo ? (fu = bar) : mouse); instead of (cat = foo) ? (fu = bar) : mouse; which makes all the difference in the world as far as what gets assigned to cat. -- Morris M. Keesan {decvax,linus,wjh12,ima}!bbncca!keesan keesan @ BBN-UNIX.ARPA