Path: news.eternal-september.org!eternal-september.org!.POSTED!not-for-mail From: Janis Papanagnou Newsgroups: comp.lang.c Subject: Re: Loops (was Re: do { quit; } else { }) Date: Tue, 13 May 2025 15:57:00 +0200 Organization: A noiseless patient Spider Lines: 28 Message-ID: References: <87a58mqt2o.fsf@nosuchdomain.example.com> <20250413072027.219@kylheku.com> <20250415153419.00004cf7@yahoo.com> <86h62078i8.fsf@linuxsc.com> <20250504180833.00000906@yahoo.com> <86plggzilx.fsf@linuxsc.com> <20250511010917.00007702@yahoo.com> <86h61qzn55.fsf@linuxsc.com> MIME-Version: 1.0 Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Injection-Date: Tue, 13 May 2025 15:57:05 +0200 (CEST) Injection-Info: dont-email.me; posting-host="6665b863c86d411340e9f9cda5abd7d0"; logging-data="1957655"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+GbRG/fhsY2zs2Xtknfr7O" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.8.0 Cancel-Lock: sha1:OggZyg2dzwZX/L84TJXZjK0TO7E= In-Reply-To: <86h61qzn55.fsf@linuxsc.com> On 12.05.2025 02:30, Tim Rentsch wrote: > [...] > > Incidentally, a language change to C was once proposed, so that > a do/while could also have an expression after the while(). > Note that this change is backwards compatible with C as it is, > because a simple semicolon after while() is an empty statement. > Adopting this proposal would mean that the language would allow, > for example > > do { > // this part will always be done at least once > // and once more for each time 'condition' is true > } while( condition ){ > // this part will be done zero or more times > } > > allowing a convenient way of writing "loop-and-a-half" type > loops. [...] This is an interesting proposal. When was it suggested, and what is the decision state? What were the arguments, pros and cons? Janis