if (condition trueCallable falseCallable -- branchResult)condition: Non-NIL Cond that selects or merges branches.trueCallable: Already-selected Block called when condition is true.falseCallable: Already-selected Block called when condition is false.branchResult: Result produced by the selected branch, or merged branch result when the condition is unknown at compile time.if selects between two already-selected Block branches by one non-NIL Cond value.
The selected branch is called through a normal call boundary. Locals created inside a branch do not remain available afterward.
For a known condition, only the selected branch is called. The unselected branch is ignored and may be invalid. For an unknown condition, both branches are compiled separately and their outputs are merged.
condition must be a non-NIL Cond value.Block values already on the data stack.condition, trueCallable, and falseCallable on the data stack.condition, trueCallable, and falseCallable are removed from the stack. Each branch sees only the remaining underlying data stack as its input.TRUE selects the first branch and FALSE selects the second branch.{} 0 {} [
"-- known TRUE selects the first branch --" printCompilerMessage
TRUE [
1
] [
impossibleName
] if printStack _:;
"-- known FALSE selects the second branch --" printCompilerMessage
FALSE [
impossibleOtherName
] [
2
] if printStack _:;
condition: FALSE dynamic;
"-- unknown condition compiles both branches --" printCompilerMessage
condition [
"-- unknown true branch --" printCompilerMessage
1
] [
"-- unknown false branch --" printCompilerMessage
2
] if printStack _:;
0
] "main" exportFunction
-- known TRUE selects the first branch --
1
-- known FALSE selects the second branch --
2
-- unknown condition compiles both branches --
-- unknown true branch --
-- unknown false branch --
Int32
call builtin (callable -- calledResult) Calls an already-selected Block, Code, callable Dict, or known Text through a call boundary. No selection happens inside the builtin.loop builtin (callable -- loopState) Repeatedly calls one already-selected Block through a call boundary. Its stack effect must be (A -- A Cond).ucall builtin (callable -- inlineResult) Processes an already-selected Block or known Text inline in the current scope.uif builtin (condition trueCallable falseCallable -- branchResult) Selects between two already-selected Block branches by a known Cond and processes the selected branch inline. No branch-output merge occurs.