Article View: comp.lang.c
Article #735Re: why &| dont work and its possible to make it work
From: fir
Date: Sat, 24 Oct 2026 13:00
Date: Sat, 24 Oct 2026 13:00
70 lines
3020 bytes
3020 bytes
chine.bleu pisze:
> scott@slp53.sl.home (Scott Lurndal) wrote:
>> fir <profesor.fir@gmail.com> writes:
>>> sady this plan of using | & failed becouse its said that here for
>>> example
>>>
>>> if(target<0 ||target>=bag_max ||!bag[target].enabled) {}
>>>
>>> if target is -1 in case of | the last one will be evalueated too
>>> and it may be segfault
>>
>> If the first test is true, the remaining tests will not be
>> executed.
>>
>> If you knew C, you'd have known that.
>>
>
> I prefer the visibility of ?: to the implicitness of || &&
>
&& you may replace by sequence
if(a) if(b) if(c) {}
which i like and maybe could use generally
|| sadly cant be replaced afair, and as i said maybe its sad it cant be
replaced by ,
if(x<0, x>=w, y<0, y>=h) return
instead
if(x<0 || x>=w || y<0 || y>=h)
here maybe first dont seem more readable but it is also matter of being
used to something
if could be replaced by "any" or "some" or "none" or "all" keywords here
also
those keywords liek higher level and human thinks more high level here
than getting down do or and and so code intentions would improve
if none (x<0, x>=w, y<0, y>=h)
{
SetPixel(x,y)
}
also there could be "non" maybe added and if so also or and and as a
keywords fit here
thise and and or more fit to keywords here than most other c keywords as
they have stright corespondence for native language keywords
eventually "if" can be skipped assuming after binary logic construct you
may just add {} liek after if
a or b {} else {}
all a b c {}
Technical Details
Message-ID:
<11bia4i$2ne4a$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:
<117mere$3a14a$1@dont-email.me> <11bda5e$vdh3$1@dont-email.me> <%EtCS.3$dnHe.0@fx46.iad> <11bi0ij$2jrg7$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: fir <profesor.fir@gmail.com> Newsgroups: comp.lang.c Subject: Re: why &| dont work and its possible to make it work Date: Sat, 24 Oct 2026 15:00:00 +0200 Organization: A noiseless patient Spider Lines: 70 Message-ID: <11bia4i$2ne4a$1@dont-email.me> References: <117mere$3a14a$1@dont-email.me> <11bda5e$vdh3$1@dont-email.me> <%EtCS.3$dnHe.0@fx46.iad> <11bi0ij$2jrg7$1@dont-email.me> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Injection-Date: Sat, 24 Oct 2026 13:00:02 +0000 (UTC) Injection-Info: dont-email.me; logging-data="2865290"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+QCGiZ8xmTwrQic6Jy9AbwJcONw74uJDI="; posting-host="b285b74d6a7e1db326de4fb86ea26fbc" User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:140.0) Gecko/20100101 Firefox/140.0 SeaMonkey/2.53.24 Cancel-Lock: sha1:zFYO2/XtY4BDalDRGkOX4v7/mSs= sha256:DOFqlCn8hx/Eqj0hD1z1HzuU4c+NkyhraeA1cpFQrjQ= sha1:souPKx0ydTItLS7rswtcR670wA8= sha256:i86YGn6VbOBwEEWcdRP5BeQ/SWzeh7mxdZWRrKrhQcQ= In-Reply-To: <11bi0ij$2jrg7$1@dont-email.me>