Article View: comp.lang.c
Article #343Re: Taming The Switch-Statement
From: bart
Date: Tue, 13 Oct 2026 17:15
Date: Tue, 13 Oct 2026 17:15
63 lines
4026 bytes
4026 bytes
On 13/10/2026 17:10, Tim Rentsch wrote: > bart <bc@freeuk.com> writes: > >> On 13/10/2026 15:40, Tim Rentsch wrote: >> >>> Michael S <already5chosen@yahoo.com> writes: >>> >> >> >>>> I thought that my comment is hard to misunderstand, but you proved >>>> me wrong. So I'd try to elaborate: >>>> >>>> switch() nested within loop is very common in my practice and I suppose >>>> in practice of everybody else. >>>> >>>> In my practice, but obviously not in practice of Tim Rentsch, it >>>> is sufficiently common to want to transfer control from point within >>>> such nested switch to point immediately following the containing loop. >>> >>> Let me clarify my earlier comment. I'm not surprised that people >>> routinely use switch() inside of loops. What did surprise me is the >>> statement that wanting to break out of the loop from inside the >>> switch() is "very common". Not happens occasionally; not happens >>> commonly or even just sufficiently commonly; not happens routinely; >>> but "very common". I am wondering now how common it actually is, >>> for switch() in general >> >> For switch in general is not meaningful: since this is about breaking >> out of a loop: a loop needs to be involved! > > Please don't make the mistake of thinking the question I am > asking is the same as the question you are interested in > answering. This is what you said: > What did surprise me is the > statement that wanting to break out of the loop from inside the > switch() is "very common". So you're talking about breaking out of a loop from inside switch? > Not happens occasionally; not happens > commonly or even just sufficiently commonly; not happens routinely; > but "very common". > I am wondering now how common it actually is, 'it' is still breaking out a loop from inside switch? > for switch() in general > and for switch() inside of a loop. So if this covers 'breaking out of a loop from inside switch', then what on earth is meant by: > for switch() in general ? Please enlighten us.
Technical Details
Message-ID:
<11alovc$o7ef$1@dont-email.me>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> <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> <864iesjx6e.fsf@linuxsc.com> <11afvqt$2kloc$1@dont-email.me> <11ag37o$2ln0a$1@dont-email.me> <11agbsh$2pbk7$1@dont-email.me> <11aggaq$2qqh9$1@dont-email.me> <11agils$2s3tg$1@dont-email.me> <11agv1t$30q22$2@kst.eternal-september.org> <20261012220256.00003d07@yahoo.com> <11ajb95$3t8jj$1@dont-email.me> <20261012223144.00000f95@yahoo.com> <86zewhhdep.fsf@linuxsc.com> <11aljoo$m15u$1@dont-email.me> <86qzhth98c.fsf@linuxsc.com>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: bart <bc@freeuk.com> Newsgroups: comp.lang.c Subject: Re: Taming The Switch-Statement Date: Tue, 13 Oct 2026 18:15:24 +0100 Organization: A noiseless patient Spider Lines: 63 Message-ID: <11alovc$o7ef$1@dont-email.me> References: <119qf6l$2rmg3$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> <864iesjx6e.fsf@linuxsc.com> <11afvqt$2kloc$1@dont-email.me> <11ag37o$2ln0a$1@dont-email.me> <11agbsh$2pbk7$1@dont-email.me> <11aggaq$2qqh9$1@dont-email.me> <11agils$2s3tg$1@dont-email.me> <11agv1t$30q22$2@kst.eternal-september.org> <20261012220256.00003d07@yahoo.com> <11ajb95$3t8jj$1@dont-email.me> <20261012223144.00000f95@yahoo.com> <86zewhhdep.fsf@linuxsc.com> <11aljoo$m15u$1@dont-email.me> <86qzhth98c.fsf@linuxsc.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Injection-Date: Tue, 13 Oct 2026 17:15:24 +0000 (UTC) Injection-Info: dont-email.me; logging-data="794063"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19UjCgZjikZ96ZHyOHzI9Lp"; posting-host="a4fe58cca8661e75894507eaca96fb60" User-Agent: Mozilla Thunderbird Cancel-Lock: sha1:kgys7BSTCAHScsURsPrDFJoGMyY= sha256:MT+gRaXu1HD7bt2HjuQLO/ab7zMRJPqQrjWj0iBU9y0= sha1:fdpsZcyJeULF1GRe4VPSGdVdFtE= sha256:HS5AUjqq3g9aIalfJi1waKIGUaqXkKwiwhvPCJKXPHQ= In-Reply-To: <86qzhth98c.fsf@linuxsc.com> Content-Language: en-GB