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: Sun, 07 Oct 2018 17:10:26 -0700 Organization: None to speak of Lines: 33 Message-ID: References: <36d546c5-b471-45fc-b87a-8ebebdc0c0b7@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> <87d0snkcs4.fsf@bsb.me.uk> <87o9c6j4fl.fsf@bsb.me.uk> <87pnwlhp1q.fsf@bsb.me.uk> <3d46f51b-bfcf-4966-8528-aa586e5e0cdb@googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Injection-Info: reader02.eternal-september.org; posting-host="044f0ceb07b55f0a559303158e3458ae"; logging-data="21172"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX191xgU13ZK9qOCOErzbaLnP" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1 (gnu/linux) Cancel-Lock: sha1:RiRCIPAtmC8HaIgkWNNs/zWkJ3U= sha1:oV6VKCtmDdyoaVKycF4PSF110JA= Xref: csiph.com comp.lang.c:136408 jameskuyper@alumni.caltech.edu writes: > On Sunday, October 7, 2018 at 1:10:01 PM UTC-4, Bart wrote: [...] >> Take a working program. Find a place where a semicolon follows what >> could be used as an expression in an expression context. Now remove the >> semicolon. If it still compiles, > > That will never happen. There is no grammar rules that permit two > consecutive expressions to occur with nothing in between them. The > closest you can get is the comma operator. There are some cases. For example: a + b; +c; and a + b; *c; Of course these cases have no relevance to whatever point Bart is failing to make. They depend on two different operators using the same symbol. In both cases, the expression (part of an expression statement) on the second line is no longer an expression after the semicolon is removed. (C's grammar happens to be what I think of as "dense", meaning roughly that it's relatively easy for arbitrary sequences of token to be syntactically valid.) [...] -- 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"