2 ms·
Yes, Forth is stack-based RPN so "IF" naturally comes after the test; "THEN" marks the end of the block; so if you want "ELSE" it ends up in the middle to let y
by morelisp 6y ago
Yes, Forth is stack-based RPN so "IF" naturally comes after the test; "THEN" marks the end of the block; so if you want "ELSE" it ends up in the middle to let you nest conditions.
: /CHECK DUP 0= IF ." invalid " DROP ELSE / THEN ;
https://www.forth.com/starting-forth/4-conditional-if-then-statements/ https://www.forth.com/starting-forth/4-conditional-if-then-s...