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: One over another: (*structp).component structp->component Date: Fri, 06 Nov 2015 12:38:25 -0800 Organization: None to speak of Lines: 34 Message-ID: References: <87pozp2zfa.fsf@bsb.me.uk> <87fv0l2ve8.fsf@bsb.me.uk> <87oaf7xt4b.fsf@bsb.me.uk> <8737wjxnm9.fsf@bsb.me.uk> <87lhabvzdq.fsf@bsb.me.uk> <527b5ade-841c-429b-8b64-0fb8959520f7@googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Injection-Info: mx02.eternal-september.org; posting-host="945944de09706c9b4e29b53c9d2efdc2"; logging-data="32488"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18aWMogKs3ewoXTqPEvmm83" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1 (gnu/linux) Cancel-Lock: sha1:DNjzeCMy7xJy4z/52VAeA8hz4ZY= sha1:X7O9O7YiS20WCLfn7DOJcixpzxU= Xref: csiph.com comp.lang.c:75180 Keith Thompson writes: > Bartc writes: >> On 06/11/2015 18:30, supercat@casperkitty.com wrote: >>> On Friday, November 6, 2015 at 11:56:01 AM UTC-6, Bart wrote: >>>> We'll have to leave it there then because we're not going to agree on >>>> anything. (For one thing, I don't consider "." or "->" operators, but >>>> syntactic constructs. Also I'm even less keen on using operator >>>> overloading!) >>> >>> I would suggest that the combination of a "." or "->" and an immediately- >>> following identifier behaves as a unary postfix operator. I'm not really >>> sure what term would best be applied to the "." or "->" since "token" is >>> over-broad, and the behavior doesn't really coincide with normal operators, >>> but I'm not sure I'd go so far as to say that the term "operator" is wrong, >>> though processing of the right-hand "operand" would be outside the normal >>> expression syntax and semantics. >> >> Even when considered to unary operators, it's by no means clear what "." >> or "->" actually do with the values on their left. > > What's unclear about it? The left operand (which must be an lvalue of > appropriate type) is evaluated. The result indicates the designated > object containing the member to which the right "operand" refers. Oops! My apologies, the left operand of `.` or `->` does not have to be an lvalue. -- 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"