Path: csiph.com!eternal-september.org!feeder.eternal-september.org!nntp.eternal-september.org!.POSTED!not-for-mail
From: Tim Rentsch
Newsgroups: comp.lang.c
Subject: Re: Taming The Switch-Statement
Date: Sat, 17 Oct 2026 10:30:31 -0700
Organization: A noiseless patient Spider
Lines: 33
Message-ID: <868q3wp748.fsf@linuxsc.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
Injection-Date: Sat, 17 Oct 2026 17:30:32 +0000 (UTC)
Injection-Info: dont-email.me; logging-data="344094"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18b8NFVpkZtVKQZdTNuY8p45I7NBpHOFAU="; posting-host="4c763b9254a7bb1ba4205cbbbbfdff4c"
User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.4 (gnu/linux)
Cancel-Lock: sha1:ZEMEKeN57Nv/0xPEulX4RF+6lGI= sha1:apYUAjVyxbazO8xWgU2oInC18CY= sha256:GZaRCo0RvtwDl0Iy/pDHVbQevm9wULS1AfWJO7f8lik= sha1:vFersJP8beXFDgc4q2RXosMqJ3E= sha256:vF/yLl5dr3ZJXrmWddk5jv18dRVq337I9wg6zvF5PNs=
Xref: csiph.com comp.lang.c:403241
Keith Thompson writes:
> Tim Rentsch writes:
>
>> Keith Thompson 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?
Before I respond I'd like to ask you to list as many potential
differentiators as you can think of, without regard to which of
the two suggestions each one benefits, and without saying which
ones you think favor one choice or the other. If you do that I
can try to go through your list, say which ones I think are
significant, which of the two choices each one favors, and maybe
also assign some sort of priority ranking. Also that would give
me a chance to think about whether there are other differentiators
not on your list but that could seem to me to be relevant.