🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.lang.c
Article #244

Re: Taming The Switch-Statement

#244
From: Jon Ribbens
Date: Sun, 11 Oct 2026 22:12
17 lines
1740 bytes
On 2026-10-11, Lawrence D’Oliveiro <ldo@nz.invalid> wrote:
> Here’s an example that matches the type of the match-expression (not
> its value) against various event subclasses:
>
>     events = iter(self.ws.events())
>     while True :
>         event = next(events, None)
>         if event == None :
>             break

Um.

Why would you do that and not:

    for event in self.ws.events():

?
Technical Details
Message-ID: <slrn11co2em.2af.jon+usenet@raven.unequivocal.eu>
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
References: <119qf6l$2rmg3$1@dont-email.me> <11ac0mi$19kfd$1@dont-email.me> <11aguua$30k5e$5@dont-email.me>

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: Jon Ribbens <jon+usenet@unequivocal.eu>
Newsgroups: comp.lang.c,comp.lang.python
Subject: Re: Taming The Switch-Statement
Date: Sun, 11 Oct 2026 22:12:38 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 17
Message-ID: <slrn11co2em.2af.jon+usenet@raven.unequivocal.eu>
References: <119qf6l$2rmg3$1@dont-email.me> <11ac0mi$19kfd$1@dont-email.me>
 <11aguua$30k5e$5@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Injection-Date: Sun, 11 Oct 2026 22:12:38 +0000 (UTC)
Injection-Info: dont-email.me;
	logging-data="3170950"; mail-complaints-to="abuse@eternal-september.org";	posting-account="U2FsdGVkX19vPGJxD2E6jPDB4FFclFl0wi733xQFYVE="; posting-host="837d912108ed60f3b33598cd1fc0533c"
User-Agent: slrn/1.0.3 (Linux)
Cancel-Lock: sha1:hXL/unRUKiwc489mfB3aek8yaAA=
	sha1:wTyOwoTOIMu7yFnDnT7NN3+RSyY= sha256:iGsa5J4mZkwGmhVxCK9HK0TwGz3KGPfakXhcRBQo3po=
	sha1:ghMvnJgBpLvOvRKYu2izRyTgPVI= sha256:IP15fdRxUDP0j/HXj+o96nbDd2RQEz5pLD1rvGWURFo=