-
Higher order word. Takes an object of stack programs with keys in the object being used to check for equality with TOS. If a match is found, executes corresponding stack program. If a default
key is specified and no other cases matched, run default
program. In all other cases throws an error.
Important: The default case has the original TOS re-added to the d-stack before execution.
-
Higher order word. Takes two stack programs: truthy and falsey branches, respectively. When executed, pops TOS and runs only one of the branches depending if TOS was truthy or not.
Note: Unlike JS if() {...} else {...}
constructs, the actual conditional is NOT part of this word.
( bool -- ? )
Similar to condq, but only expects test
result and truthy branch d-stack. Executes word/quotation if test
is truthy, else does nothing.
( test whenq -- ? )
-
Generated using TypeDoc
Non-HOF version of {@link cond}, expects
test
result and both branches on d-stack. Executesthenq
word/quotation iftest
is truthy, else runselseq
.( test thenq elseq -- ? )