Path: utzoo!attcan!uunet!samsung!think!snorkelwacker!spdcc!ima!haddock!karl From: karl@haddock.ima.isc.com (Karl Heuer) Newsgroups: comp.lang.c Subject: Re: () ignored in some expressions Message-ID: <16440@haddock.ima.isc.com> Date: 11 Apr 90 17:03:44 GMT References: <48079@lanl.gov> <1272@sdrc.UUCP> <1458@tkou02.enet.dec.com> Reply-To: karl@haddock.ima.isc.com (Karl Heuer) Organization: Interactive Systems, Cambridge, MA 02138-5302 Lines: 13 In article <1458@tkou02.enet.dec.com> diamond@tkou02.enet.dec.com (diamond@tkovoa) writes: >In article <1272@sdrc.UUCP> scjones@sdrc.UUCP (Larry Jones) writes: >>ANSI C requires that all expressions be evaluated as >>written. Thus for "a + b + c" the compiler must add a and b >>first, then add c to the result. > >No. For "a + b + c", the compiler may add a + c, then add b No, since `+' associates left to right, `a+b+c' and `(a+b)+c' are equivalent. It's a common myth that parens apply some type of magic binding, but all they do is specify the parse tree. Karl W. Z. Heuer (karl@ima.ima.isc.com or harvard!ima!karl), The Walking Lint