Article View: comp.lang.c
Article #472Re: Taming The Switch-Statement
From: Michael S
Date: Sat, 17 Oct 2026 16:39
Date: Sat, 17 Oct 2026 16:39
41 lines
3530 bytes
3530 bytes
On Fri, 16 Oct 2026 15:00:27 -0700
Keith Thompson <Keith.S.Thompson+u@gmail.com> wrote:
> Tim Rentsch <tr.17687@z991.linuxsc.com> writes:
> > Keith Thompson <Keith.S.Thompson+u@gmail.com> writes:
> >> I find "break NAME;", where "NAME" is the name of an enclosing
> >> construct, unambiguously better than "break N;", where N is the
> >> number of levels to break out of. [...]
> >
> > Definitely.
> >
> >> There's a proposal for C2y to use goto labels as loop names, and a
> >> competing one to define a new syntax like "for NAME (;;)" :
> >>
> >> https://www.open-std.org/jtc1/sc22/wg14/www/docs/n3355.htm
> >> https://www.open-std.org/jtc1/sc22/wg14/www/docs/n3377.pdf
> >
> > I'm not particularly a fan of multi-level break/continue. But if
> > we're going to have one of these, the second ("for NAME (;;)") is
> > unquestionably better.
>
> Unquestionably? Why?
>
I don't know why Tim prefers it.
I prefer it (strongly) because it is different from regular label. So
reader that wants to understand a flow of the program should not be
concerned with possibility of jumping to it from places outside for().
> I do like the fact that it doesn't conflate goto labels with loop
> names, but I still prefer the "NAME: for (;;)" form, partly because
> it's consistent with several other languages.
>
You mentioned itself that in Ada loop labels are distinct from regular
labels. I would think that Ada alone easily outweighs "several other
languages" if we compare by number (and likely by quality) of man-hours
invested into thinking and discussion of syntactic features.
Anyway I value appeal to success more than appeal to authority so by my
own standards the argument above is weak.
Technical Details
Message-ID:
<20261017193908.00000106@yahoo.com>Path:
mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!eternal-september.org!feeder.eternal-september.org!nntp.eternal-september.org!.POSTED!not-for-mailReferences:
<119qf6l$2rmg3$1@dont-email.me> <11ac0mi$19kfd$1@dont-email.me> <11ac2jv$1a84t$1@dont-email.me> <11ac783$1bkuo$1@kst.eternal-september.org> <11ad5eq$1l8hg$1@dont-email.me> <11ad9fg$cjm0$4@dont-email.me> <11addhr$1oakb$1@dont-email.me> <11aduuk$cjlv$1@dont-email.me> <20261010220212.000063fd@yahoo.com> <11ae56o$cjlv$4@dont-email.me> <20261010230355.00005189@yahoo.com> <11ae7eb$cjlv$6@dont-email.me> <11aeee0$24k8m$1@kst.eternal-september.org> <11aer17$286ml$2@dont-email.me> <11aeusp$29hmu$2@kst.eternal-september.org> <86mrsdpcgp.fsf@linuxsc.com> <11au6pr$3mdne$1@kst.eternal-september.org>Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!eternal-september.org!feeder.eternal-september.org!nntp.eternal-september.org!.POSTED!not-for-mail From: Michael S <already5chosen@yahoo.com> Newsgroups: comp.lang.c Subject: Re: Taming The Switch-Statement Date: Sat, 17 Oct 2026 19:39:08 +0300 Organization: A noiseless patient Spider Lines: 41 Message-ID: <20261017193908.00000106@yahoo.com> References: <119qf6l$2rmg3$1@dont-email.me> <11ac0mi$19kfd$1@dont-email.me> <11ac2jv$1a84t$1@dont-email.me> <11ac783$1bkuo$1@kst.eternal-september.org> <11ad5eq$1l8hg$1@dont-email.me> <11ad9fg$cjm0$4@dont-email.me> <11addhr$1oakb$1@dont-email.me> <11aduuk$cjlv$1@dont-email.me> <20261010220212.000063fd@yahoo.com> <11ae56o$cjlv$4@dont-email.me> <20261010230355.00005189@yahoo.com> <11ae7eb$cjlv$6@dont-email.me> <11aeee0$24k8m$1@kst.eternal-september.org> <11aer17$286ml$2@dont-email.me> <11aeusp$29hmu$2@kst.eternal-september.org> <86mrsdpcgp.fsf@linuxsc.com> <11au6pr$3mdne$1@kst.eternal-september.org> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Injection-Date: Sat, 17 Oct 2026 16:39:15 +0000 (UTC) Injection-Info: dont-email.me; logging-data="381826"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/a4JnjRBwU1qMdwcLHxZcz4ByTvuF5MUA="; posting-host="8a2717059b3cb9979a1bc36c42d7abf4" Cancel-Lock: sha1:WCVJouO3TW2q00c2IWoWBHdXvfI= sha256:27BFyWbGFbpF6ZY8/tnmn40oCzx6H9dBPRGsckVXc7Q= sha1:hoA8Cxf/ZSnGKULiA3dCwslYNs4= sha256:PnZQLS7PErfQmPJJzz2yMC21cri8sjzPiYEqp3BjLIE= X-Newsreader: Claws Mail 4.1.1 (GTK 3.24.34; x86_64-w64-mingw32)