Deutsch   English   Français   Italiano  
<v3mkbu$bpds$4@dont-email.me>

View for Bookmarking (what is this?)
Look up another Usenet article

Path: ...!3.eu.feeder.erje.net!feeder.erje.net!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: David Brown <david.brown@hesbynett.no>
Newsgroups: comp.lang.c
Subject: Re: C23 thoughts and opinions
Date: Tue, 4 Jun 2024 10:47:58 +0200
Organization: A noiseless patient Spider
Lines: 30
Message-ID: <v3mkbu$bpds$4@dont-email.me>
References: <v2l828$18v7f$1@dont-email.me>
 <v2o57g$1t5p4$1@raubtier-asyl.eternal-september.org>
 <v3dkgh$2e0me$1@dont-email.me> <v3gou9$36n61$3@dont-email.me>
 <v3hrq7$1o743$1@news.xmission.com> <v3i7u3$3bp0v$1@dont-email.me>
 <20240602124448.704@kylheku.com> <v3lgti$325i$1@dont-email.me>
 <v3ltlr$48om$16@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Date: Tue, 04 Jun 2024 10:47:59 +0200 (CEST)
Injection-Info: dont-email.me; posting-host="7740955b17fd8df0cccaba227b9e3b39";
	logging-data="386492"; mail-complaints-to="abuse@eternal-september.org";	posting-account="U2FsdGVkX1/xkHp1Rfbf3+fhfgE1/vaaojA4Ic40qpM="
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101
 Thunderbird/102.11.0
Cancel-Lock: sha1:rSzektUvn9hZNcUid65tujEc0q8=
In-Reply-To: <v3ltlr$48om$16@dont-email.me>
Content-Language: en-GB
Bytes: 2353

On 04/06/2024 04:20, Lawrence D'Oliveiro wrote:
> On Mon, 3 Jun 2024 23:43:00 +0100, bart wrote:
> 
>> All that suggest sto me is that the language *needs* an explicit endless
>> loop!
> 
> I agree. Also it is common for a loop to have multiple exits, and I don’t
> like treating one of them as a special “termination condition” above the
> others, so I like to use “break” for all of them.
> 
> The “for” form not only caters for this, it allows handy initialization of
> local variables that keep their value between loop iterations. E.g.
> 
>      for (unsigned int i = length_of(array);;)
>        {
>          if (i == 0)
>            {
>              ... not found ...
>              break;
>            } /*if*/
>          --i;
>          if (... array[i] matches what I want ...)
>            {
>              .. found ...
>              break;
>            } /*if*/
>        } /*for*/

Now we know Keith was right that people are joking!