• why &| dont work and its possible to make it work

    From fir@3:633/10 to All on Mon Sep 7 15:39:55 2026
    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?

    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?

    overally seem oryginal C or even B was bests, then some populists come
    (i name them populists, people with medicore mind lower than oryginal c quality - who was many and this majority make c worse even in back times
    of first changes

    --- PyGate Linux v1.5.19
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)
  • From bart@3:633/10 to All on Mon Sep 7 16:42:13 2026
    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.



    --- PyGate Linux v1.5.19
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)
  • From Bonita Montero@3:633/10 to All on Mon Sep 7 17:49:18 2026
    Am 07.09.2026 um 15:39 schrieb fir:

    as i once said i decided to not use && and || as it annoys me (same s == annoys me)
    Sick !

    --- PyGate Linux v1.5.19
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)
  • From fir@3:633/10 to All on Mon Sep 7 18:14:14 2026
    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)
  • From fir@3:633/10 to All on Mon Sep 7 18:22:57 2026
    Bonita Montero pisze:
    Am 07.09.2026 um 15:39 schrieb fir:

    as i once said i decided to not use && and || as it annoys me (same s
    == annoys me)
    Sick !

    well, it works, under some ciricumstances..and looks better and good
    look matter


    from my post above it seems that | works in all cases (it is when you
    mix logical and bit components) but & will prbably not work if you will
    mix bit components which are even values/has lowest bit 0

    (i would need to check it yet

    also there mat be chaged operator precedence


    as i said it is clear to me that && || are C language design flaw

    some common rule here would be not mix bitwise with logical

    --- PyGate Linux v1.5.19
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)