• alternative forms of if

    From fir@profesor.fir@gmail.com to comp.lang.c on Thu Nov 26 17:54:04 2026
    From Newsgroup: comp.lang.c

    thinking on this i get to sema conclusion that maybe if should have more
    form like

    a T{} F{} Z{} -1{}

    this is becouse one could say else is misleading its maybe mofe
    if ( something ) YES {} NO {}

    not just else..else being accused of being misleading here

    note in assembly when youre doing compares

    (from ai

    Common conditional jumps
    Instruction Condition
    JE / JZ Equal / zero
    JNE / JNZ Not equal / not zero
    JC / JB Carry / below (unsigned)
    JNC / JAE No carry / above or equal (unsigned)
    JA Above (unsigned)
    JBE Below or equal (unsigned)
    JG Greater (signed)
    JGE Greater or equal (signed)
    JL Less (signed)
    JLE Less or equal (signed)
    JO Overflow
    JNO No overflow
    JS Sign set
    JNS Sign not set
    JP / JPE Parity even
    JNP / JPO Parity odd
    )


    so if you do

    a T{} F{} Z{} C{}

    you could use more conditions than just else

    T being for true here F for false Z for zero NZ for non zero C for carry etc

    you could also gave immediate values this extending if to simple switch

    a T{} 2{} 9{}

    gets in if a is true and gets in if 2 or 9

    obviously those letters look weird but that is only illustration of some
    idea that something wronng may be with else..else may be mistake

    --- Synchronet 3.21e-Linux NewsLink 1.2