Path: csiph.com!eternal-september.org!feeder.eternal-september.org!mx02.eternal-september.org!.POSTED!not-for-mail From: Keith Thompson Newsgroups: comp.lang.c Subject: Re: ->= Date: Fri, 27 Nov 2015 19:37:28 -0800 Organization: None to speak of Lines: 34 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Injection-Info: mx02.eternal-september.org; posting-host="945944de09706c9b4e29b53c9d2efdc2"; logging-data="28147"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+aegit9RsNzomBfaqE6Hbk" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1 (gnu/linux) Cancel-Lock: sha1:YnEFFc4Je6A6GJKrw7AeNI44Ubg= sha1:scNa2wb5yO6u/cecs/nhett+2sA= Xref: csiph.com comp.lang.c:77304 BartC writes: [...] >> On Friday, November 27, 2015 at 4:15:37 PM UTC-6, Tim Rentsch wrote: [...] > >> best it's no more than syntactic saccharin. Note also it > >> requires revising the rule stated in the first sentence of > >> 6.5.16.2 p3. Kind of sticks out like a sort thumb. > > I didn't understand that bit. But I can see that if a member name > normally only follows a "." or "->" token, now it will need to be > allowed after "->=" too. It can't just be mapped to = and ->, unless the > implementation ensures that any side-effects occur just once. 6.5.16.2p3 says: A compound assignment of the form E1 op = E2 is equivalent to the simple assignment expression E1 = E1 op (E2), except that the lvalue E1 is evaluated only once, and with respect to an indeterminately-sequenced function call, the operation of a compound assignment is a single evaluation. The semantics of the `->=` operator would have to be defined without the parentheses, since `foo->(bar)` is illegal even when `foo->bar` is legal. Not a fatal problem, but it would be one more special case. (Tim: I suggest that you'd save a some people some time if you'd quote the sentence rather than just citing the section and paragraph number.) -- Keith Thompson (The_Other_Keith) kst-u@mib.org Working, but not speaking, for JetHead Development, Inc. "We must do something. This is something. Therefore, we must do this." -- Antony Jay and Jonathan Lynn, "Yes Minister"