Path: utzoo!attcan!utgpu!jarvis.csri.toronto.edu!rutgers!tut.cis.ohio-state.edu!quanta.eng.ohio-state.edu!kaa.eng.ohio-state.edu!rob From: rob@kaa.eng.ohio-state.edu (Rob Carriere) Newsgroups: comp.lang.c Subject: Re: Another silly question Message-ID: <2206@quanta.eng.ohio-state.edu> Date: 18 May 89 01:02:16 GMT References: <17812@cup.portal.com> <2336@Portia.Stanford.EDU> Sender: news@quanta.eng.ohio-state.edu Reply-To: rob@kaa.eng.ohio-state.edu (Rob Carriere) Organization: Ohio State Univ, College of Engineering Lines: 20 In article <2336@Portia.Stanford.EDU> mesmo@Portia.Stanford.EDU (Chris Johnson) writes: > The supposed proof of a[i] == i[a] rests on the faulty > assumption that (x+y) == (y+x) in all contexts; this is > not correct. No it doesn't. It relies on a direct statement in K&R I (pg 210, 1st par) "Therefore, despite its asymmetric appearance, subscripting is a commutative operation." > When "+" denotes simple (ie int/float/etc) arithmetic, the > operation commutes; when it denotes pointer arithmetic, > commutation is not legal/meaningful. There is no such statement in K&R; in fact, the paragraph from the above quote came implies the oppposite and so does the section on the "+" operator (A7.4, pg188--189) SR