🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

1 total messages Started by fir Thu, 26 Nov 2026 16:54
alternative forms of if
#1874
Author: fir
Date: Thu, 26 Nov 2026 16:54
52 lines
2419 bytes
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
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads