🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.lang.c
Article #821

Re: Taming The Switch-Statement

#821
From: bartc
Date: Mon, 26 Oct 2026 21:11
62 lines
3742 bytes
On 26/10/2026 20:32, fir wrote:
> bartc pisze:

>> OK, try a simple experiment: convert some code using your 'or' keyword 
>> to regular C syntax and post it here. Preferably on a real example.
>>
> 
> you cant properly convert this or/and groups to c in good way becouse 
> there is flaw in c you cannot express all needed combinations generally 
> with sole if 's and else's
> 
> as was showed here
There are a couple of reasons to express it in C:

* To illustrate exactly how you want the semantics to work, via
   an existing language whose behaviour is well known

* To highlight the problem areas

For example:

   if (f1()) {}
   if (f2()) {}
   ...
   if (!f1() && !f2()) {}

Here f1/f2 are called twice. This means making internal copies or 
setting flags.


>> You'll find, when converting to regular C, that detecting the case of 
>> all false will mean checking all conditions, but now those will 
>> contain duplicates. It is hard to cleanly express, which is a bad sign 
>> as a prospective language feature.
> 
> 
> i dont like get what you talk here..overally this is a work for compiler
> to simplify it in output

In my case the compiler is my job too!

> btw you think i should defend the things i was talking about -
> i more see its a waste of time if someone dont understand things
> it is for him if he understoods or not, i have not so much time to 
> defend obvious things against the people who not care to much to 
> understand things
> 
> i would sy like its taking hours repairing a code that is
> good - whou would like to do it?
> 
> 
> generally such time spanding that you got good code and some weird 
> people come nad put a bulshit its wrong and expect me to explain this is 
> not its not a good time spending imo

> i would rather expect if some will find some 'bug ' in code then he 
> first should understand it

Why bother posting in a public forum if you don't care about people 
understand what you're on about? Do you not want people to engage?

Then post to alt.test instead.
Technical Details
Message-ID: <11bofl7$vjil$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-mail
References: <119qf6l$2rmg3$1@dont-email.me> <11ba02r$3pl5h$1@dont-email.me> <11bnfpm$i84l$1@dont-email.me> <11bng23$iblc$1@dont-email.me> <11bngj1$ifj5$1@dont-email.me> <11bnnbg$l7i1$1@dont-email.me> <11bntk0$nsbo$1@dont-email.me> <11bnvbq$olbj$1@dont-email.me> <11bo02r$otr5$1@dont-email.me> <11bo0ul$pbso$1@dont-email.me> <11bo1bc$phlr$1@dont-email.me> <11bo86r$sgm6$1@dont-email.me> <11boaad$td13$1@dont-email.me> <11bobf0$tsad$1@dont-email.me> <11bodc6$ul1k$1@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: bartc <bc@freeuk.com>
Newsgroups: comp.lang.c
Subject: Re: Taming The Switch-Statement
Date: Mon, 26 Oct 2026 21:11:03 +0000
Organization: A noiseless patient Spider
Lines: 62
Message-ID: <11bofl7$vjil$1@dont-email.me>
References: <119qf6l$2rmg3$1@dont-email.me> <11ba02r$3pl5h$1@dont-email.me>
 <11bnfpm$i84l$1@dont-email.me> <11bng23$iblc$1@dont-email.me>
 <11bngj1$ifj5$1@dont-email.me> <11bnnbg$l7i1$1@dont-email.me>
 <11bntk0$nsbo$1@dont-email.me> <11bnvbq$olbj$1@dont-email.me>
 <11bo02r$otr5$1@dont-email.me> <11bo0ul$pbso$1@dont-email.me>
 <11bo1bc$phlr$1@dont-email.me> <11bo86r$sgm6$1@dont-email.me>
 <11boaad$td13$1@dont-email.me> <11bobf0$tsad$1@dont-email.me>
 <11bodc6$ul1k$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Mon, 26 Oct 2026 21:11:04 +0000 (UTC)
Injection-Info: dont-email.me;
	logging-data="1035861"; mail-complaints-to="abuse@eternal-september.org";	posting-account="U2FsdGVkX1/x0r3DgxGaaRhTXnImf6qu"; posting-host="81ec4569ad44d616cf39a71786ebce1e"
User-Agent: Mozilla Thunderbird
Cancel-Lock: sha1:LiA0hEXi166/+cexJXvwT/GqiBI= sha256:fSsio/H7MTQF8pKa2OzkS8b+weOOIVeXv4YNasNBZ5E=
	sha1:3Isd76tFwLGebjys456N2+6Mcrs= sha256:1kDGtsSSvoAQ+Byi2D7a0r1JJcSAnlXPbI/NqGOUoUA=
Content-Language: en-GB
In-Reply-To: <11bodc6$ul1k$1@dont-email.me>