bart pisze:
On 07/09/2026 14:39, fir wrote:
as i once said i decided to not use && and || as it annoys me (same s
== annoys me)
so i will decide to use & | insted but as i not code regullarry today
i not yet maneged to test it throughly when it not work and
if it need big changes in languege to work
i mean one option is that & | should work for BOTH logical and bitwise
is it possible?
No, because they do different things. But if you can only have one, then
& and | are˙ more flexible:
I think 'A && B' is equivalent to˙ '(!!A ? 1 : (!!B ? 1 : 0))', if a
boolean result is needed.
You can't do '!!A & !!B' because && short-circuits.
if not i wuld probably suggest using some other methods to make it
work (i could eventually say that &| would better work for logical and
&& || for bitwise but im not saing this becouse it would alos be bad imo)
so maybe better it should work for both (?)
if it not brings some problems i suspect something like
3&4 has different meaning in logical (1) and bitwise (7) but is that a
problem?
Yeah, it's a problem: 3&4 has result 0, but 3&&4 has result 1. But in
this case, (!!3)&(!!4) can be used to give 1.
lol i misluked it - i thought 3&4 is 7
its kinda confusing
3&4 is logically true, so bitewise also should be true here t work, i guess
3|4 is logically also true , so bitewise it also should be true ?
to make it work?
"logical" operators and and or are for sure defined well in thsi sense
tahat A & B & C should be tru if all are true. otherwise false,
A|B|C should be true if only one or more is true.. though natural
reading here is confusing becouse for me as i said 3&4 for me "reads"as
7 (3|4 also "reads" as 7 probably)
it seems that those mathematical signs u and close to n (reversed u)
could fir better 3u4 = 7 3n4 = 0
SO
it seems that indeed & and | would not work becouse
A & 3 & 4 & B when A and B are true should give true
(and i assume A and B would be presented as 1 so result is 0)
A |3 |4 |B will give 7 - so in this case its ok, so it seems | work but
& fails
--- PyGate Linux v1.5.19
* Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)