Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.c > #168611
| From | Ben Bacarisse <ben.usenet@bsb.me.uk> |
|---|---|
| Newsgroups | comp.lang.c |
| Subject | Re: Christmas Quiz 2022 |
| Date | 2022-12-20 14:57 +0000 |
| Organization | A noiseless patient Spider |
| Message-ID | <87ili6unpn.fsf@bsb.me.uk> (permalink) |
| References | <tnnspa$27vkp$1@paganini.bofh.team> <20221220054654.91@kylheku.com> <87tu1quou7.fsf@bsb.me.uk> <tnshp9$mh7i$1@dont-email.me> |
Lew Pitcher <lew.pitcher@digitalfreehold.ca> writes: > On Tue, 20 Dec 2022 14:33:36 +0000, Ben Bacarisse wrote: > >> Kaz Kylheku <864-117-4973@kylheku.com> writes: >> >>> On 2022-12-18, Roman P <invalid@example.com> wrote: >>>> 6) What are the three parts of a for statement and which of them are >>>> required? >>> >>> Check your fingers; I count nine: >>> >>> for ( init ; test ; step ) stmt 1 2 3 4 5 6 7 8 9 >> >> or possibly 8: >> >> for ( declaration test ; step ) stmt 1 2 3 4 5 6 7 >> 8 >> >> depending on what you include in "init". > > The C11 draft standard defines the for statement as > for ( clause-1 ; expression-2 ; expression-3 ) statement I was reading N1570 that is (I think) a draft of C11. What is your source? > where > clause-1 may be a declaration or an expression. In N1570, a declaration includes a semicolon but an expression does not so I can't see how that can work. > The notable point is that the semicolon between clause-1 > and expression-2 is /not/ part of clause-1, but is, instead > part of the for statement itself. But that does not help if the grammar for a declaration still includes a semicolon. I wonder what all the relevant parts of the draft you are referring to look like when taken together. > Because of this, I don't believe that your count can be correct. > But, I'm willing to be educated on this :-) Well, I did add (but then deleted) that the count depends on how the grammar is structured. I should look at a more recent draft that will have taken the confirmed C11 text as a starting point. I might do that later, but I am in a rush! -- Ben.
Back to comp.lang.c | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
Christmas Quiz 2022 Roman P <invalid@example.com> - 2022-12-18 20:00 +0000
Re: Christmas Quiz 2022 Tony Oliver <guinness.tony@gmail.com> - 2022-12-18 13:18 -0800
Re: Christmas Quiz 2022 Keith Thompson <Keith.S.Thompson+u@gmail.com> - 2022-12-18 16:48 -0800
Re: Christmas Quiz 2022 Tim Rentsch <tr.17687@z991.linuxsc.com> - 2022-12-18 17:18 -0800
Re: Christmas Quiz 2022 "Chris M. Thomasson" <chris.m.thomasson.1@gmail.com> - 2022-12-19 19:39 -0800
Re: Christmas Quiz 2022 Niles Rogoff <eternal-september@niles.xyz> - 2022-12-27 01:22 -0800
Re: Christmas Quiz 2022 Öö Tiib <ootiib@hot.ee> - 2022-12-27 01:58 -0800
Re: Christmas Quiz 2022 Keith Thompson <Keith.S.Thompson+u@gmail.com> - 2022-12-27 10:25 -0800
Re: Christmas Quiz 2022 James Kuyper <jameskuyper@alumni.caltech.edu> - 2022-12-27 05:07 -0500
Re: Christmas Quiz 2022 scott@slp53.sl.home (Scott Lurndal) - 2022-12-27 16:06 +0000
Re: Christmas Quiz 2022 scott@slp53.sl.home (Scott Lurndal) - 2022-12-27 17:42 +0000
Re: Christmas Quiz 2022 Keith Thompson <Keith.S.Thompson+u@gmail.com> - 2022-12-27 13:53 -0800
Re: Christmas Quiz 2022 Niles Rogoff <eternal-september@niles.xyz> - 2022-12-27 01:24 -0800
Re: Christmas Quiz 2022 scott@slp53.sl.home (Scott Lurndal) - 2022-12-27 16:07 +0000
Re: Christmas Quiz 2022 Ben Bacarisse <ben.usenet@bsb.me.uk> - 2022-12-18 21:22 +0000
Re: Christmas Quiz 2022 Lew Pitcher <lew.pitcher@digitalfreehold.ca> - 2022-12-18 21:40 +0000
Re: Christmas Quiz 2022 Tim Rentsch <tr.17687@z991.linuxsc.com> - 2022-12-18 17:02 -0800
Re: Christmas Quiz 2022 Tim Rentsch <tr.17687@z991.linuxsc.com> - 2022-12-18 17:20 -0800
Re: Christmas Quiz 2022 red floyd <no.spam.here@its.invalid> - 2022-12-18 13:36 -0800
Re: Christmas Quiz 2022 "Chris M. Thomasson" <chris.m.thomasson.1@gmail.com> - 2022-12-18 13:48 -0800
Re: Christmas Quiz 2022 Siri Cruise <chine.bleu@yahoo.com> - 2022-12-18 14:57 -0800
Re: Christmas Quiz 2022 "Chris M. Thomasson" <chris.m.thomasson.1@gmail.com> - 2022-12-18 15:43 -0800
Re: Christmas Quiz 2022 Lynn McGuire <lynnmcguire5@gmail.com> - 2022-12-19 23:40 -0600
Re: Christmas Quiz 2022 "Chris M. Thomasson" <chris.m.thomasson.1@gmail.com> - 2022-12-20 14:01 -0800
Re: Christmas Quiz 2022 Kaz Kylheku <864-117-4973@kylheku.com> - 2022-12-20 13:49 +0000
Re: Christmas Quiz 2022 Ben Bacarisse <ben.usenet@bsb.me.uk> - 2022-12-20 14:33 +0000
Re: Christmas Quiz 2022 Lew Pitcher <lew.pitcher@digitalfreehold.ca> - 2022-12-20 14:44 +0000
Re: Christmas Quiz 2022 Ben Bacarisse <ben.usenet@bsb.me.uk> - 2022-12-20 14:57 +0000
Re: Christmas Quiz 2022 Lew Pitcher <lew.pitcher@digitalfreehold.ca> - 2022-12-20 15:03 +0000
Re: Christmas Quiz 2022 David Brown <david.brown@hesbynett.no> - 2022-12-20 16:32 +0100
Re: Christmas Quiz 2022 Lew Pitcher <lew.pitcher@digitalfreehold.ca> - 2022-12-20 15:41 +0000
Re: Christmas Quiz 2022 Keith Thompson <Keith.S.Thompson+u@gmail.com> - 2022-12-20 10:22 -0800
Re: for() syntax (Was: Christmas Quiz 2022) Lew Pitcher <lew.pitcher@digitalfreehold.ca> - 2022-12-20 18:54 +0000
Re: for() syntax Keith Thompson <Keith.S.Thompson+u@gmail.com> - 2022-12-20 12:08 -0800
Re: for() syntax (Was: Christmas Quiz 2022) Tim Rentsch <tr.17687@z991.linuxsc.com> - 2022-12-26 06:48 -0800
Re: Christmas Quiz 2022 Tim Rentsch <tr.17687@z991.linuxsc.com> - 2022-12-26 06:25 -0800
Re: Christmas Quiz 2022 Tim Rentsch <tr.17687@z991.linuxsc.com> - 2022-12-26 06:24 -0800
Re: Christmas Quiz 2022 Keith Thompson <Keith.S.Thompson+u@gmail.com> - 2022-12-26 13:05 -0800
Re: Christmas Quiz 2022 Andrey Tarasevich <andreytarasevich@hotmail.com> - 2022-12-20 12:46 -0800
Re: Christmas Quiz 2022 Paavo Helde <eesnimi@osa.pri.ee> - 2022-12-20 23:49 +0200
Re: Christmas Quiz 2022 Andrey Tarasevich <andreytarasevich@hotmail.com> - 2022-12-20 14:00 -0800
Re: Christmas Quiz 2022 Paavo Helde <eesnimi@osa.pri.ee> - 2022-12-21 00:13 +0200
Re: Christmas Quiz 2022 Andrey Tarasevich <andreytarasevich@hotmail.com> - 2022-12-20 14:38 -0800
Re: Christmas Quiz 2022 Andrey Tarasevich <andreytarasevich@hotmail.com> - 2022-12-20 21:31 -0800
Re: Christmas Quiz 2022 David Brown <david.brown@hesbynett.no> - 2022-12-21 12:02 +0100
csiph-web