Path: csiph.com!eternal-september.org!feeder.eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail From: Keith Thompson Newsgroups: comp.lang.c Subject: Re: >< swap operator Date: Sat, 06 Oct 2018 13:05:39 -0700 Organization: None to speak of Lines: 28 Message-ID: References: <36d546c5-b471-45fc-b87a-8ebebdc0c0b7@googlegroups.com> <87sh1mqvmt.fsf@bsb.me.uk> <87muruqto8.fsf@bsb.me.uk> <877eiyq8y9.fsf@bsb.me.uk> <4c752ee6-5c30-4e8c-8d50-32a42554bb50@googlegroups.com> <878t3dpsl6.fsf@bsb.me.uk> <3f3b2fe4-5729-432c-889e-2f016b52dc45@googlegroups.com> <9d5c4ae9-47ef-4da0-9b39-e7dbc96ab1be@googlegroups.com> <87va6gjile.fsf@bsb.me.uk> <87tvlzhtqr.fsf@bsb.me.uk> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Injection-Info: reader02.eternal-september.org; posting-host="04a4b922a9e1d576999de619c7c3138f"; logging-data="8072"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+v04lJ5eFODGKcZcgB65sy" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1 (gnu/linux) Cancel-Lock: sha1:beS2AkwIPosaSdo30vyc5a2VNUQ= sha1:7lm0wFeQFfUXlyAnRAO8apuTvT0= Xref: csiph.com comp.lang.c:136360 Bart writes: > On 06/10/2018 18:26, Ben Bacarisse wrote: [...] >> I think we are talking at cross-purposes. I am simply saying that C >> maintains a strict demarcation between statements and expressions. > > Which for all intents and purposes doesn't exist. Of course it does. > While it is usually one way - an expression can be made into a statement > - with gcc's extension it goes both ways with statements becoming > expressions (I think you wrap ({...}) around them). `x = 42` is an expression, and is not a statement. `x = 42;` is a statement, and is not an expression. There is no construct in C (barring silly macro tricks) that is both an expression and a statement. There is no ambiguity, in spite of your attempts to believe that there is. That's what we me by a strict demarcation between statements and expressions. -- 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"