Sujet : Re: goto considered helpful
De : Keith.S.Thompson+u (at) *nospam* gmail.com (Keith Thompson)
Groupes : comp.lang.cDate : 13. Dec 2024, 19:11:56
Autres entêtes
Organisation : None to speak of
Message-ID : <87o71fv4er.fsf@nosuchdomain.example.com>
References : 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
User-Agent : Gnus/5.13 (Gnus v5.13)
bart <
bc@freeuk.com> writes:
On 13/12/2024 13:19, David Brown wrote:
On 13/12/2024 12:12, bart wrote:
[...]
I've had a quick look through my codebases (not C), and I couldn't
see an example of a numbered break. All I could find was the
equivalant of:
>
break # the vast majority
break all
>
The latter breaks out of the outermost loop.
>
So you have a feature (numbered breaks) in your language that you
never use, but have been recommending here as a useful addition to
C?
>
I'm saying that if you don't have the general feature, then the more
limited one might be worth considering, as it will take care of most
of the use-cases not covered by break.
In current C, we don't have either feature.
I suggest that covering *most* of the use-cases would not be good
enough. Adding your "break all" to C (defining it in the standard
and implementing it in compilers) would not be significantly easier
than adding "break LABEL". I see no point in adding a partial
feature when a more complete feature is (a) just as easy, and (b)
has ample precedent in other languages.
-- Keith Thompson (The_Other_Keith) Keith.S.Thompson+u@gmail.comvoid Void(void) { Void(); } /* The recursive call of the void */