Re: C23 thoughts and opinions

Liste des GroupesRevenir à cl c 
Sujet : Re: C23 thoughts and opinions
De : david.brown (at) *nospam* hesbynett.no (David Brown)
Groupes : comp.lang.c
Date : 04. Jun 2024, 09:47:58
Autres entêtes
Organisation : A noiseless patient Spider
Message-ID : <v3mkbu$bpds$4@dont-email.me>
References : 1 2 3 4 5 6 7 8 9
User-Agent : Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.11.0
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!

Date Sujet#  Auteur
31 May 24 * Re: C23 thoughts and opinions20Lynn McGuire
1 Jun 24 +- Re: C23 thoughts and opinions1David Brown
2 Jun 24 `* Re: C23 thoughts and opinions18Lawrence D'Oliveiro
2 Jun 24  +- Re: C23 thoughts and opinions1Keith Thompson
2 Jun 24  `* Re: C23 thoughts and opinions16Kenny McCormack
2 Jun 24   `* Re: C23 thoughts and opinions15Lew Pitcher
2 Jun 24    +* Re: C23 thoughts and opinions13Kaz Kylheku
3 Jun 24    i+- Re: C23 thoughts and opinions1Michael S
3 Jun 24    i+* Re: C23 thoughts and opinions5Tim Rentsch
3 Jun 24    ii`* Re: C23 thoughts and opinions4Chris M. Thomasson
3 Jun 24    ii `* Re: C23 thoughts and opinions3Kenny McCormack
4 Jun 24    ii  `* Re: C23 thoughts and opinions2David Brown
4 Jun 24    ii   `- Re: C23 thoughts and opinions1Chris M. Thomasson
3 Jun 24    i`* Re: C23 thoughts and opinions6bart
4 Jun 24    i +* Re: C23 thoughts and opinions2Keith Thompson
4 Jun 24    i i`- Re: C23 thoughts and opinions1David Brown
4 Jun 24    i +* Re: C23 thoughts and opinions2Lawrence D'Oliveiro
4 Jun 24    i i`- Re: C23 thoughts and opinions1David Brown
4 Jun 24    i `- Re: C23 thoughts and opinions1Kaz Kylheku
3 Jun 24    `- Re: C23 thoughts and opinions1Tim Rentsch

Haut de la page

Les messages affichés proviennent d'usenet.

NewsPortal