Vocabulary
kernel

Inputs
defaultan object
conda generalized boolean
truea quotation with stack effect ( ..a cond -- ..b )
falsea quotation with stack effect ( ..a default -- ..b )


Outputs
None

Word description
If the condition is f, the false quotation is called with the default value on the stack. Otherwise, the true quotation is called with the condition on the stack.

Notes
The following two lines are equivalent:
[ X ] [ Y ] ?if dup [ nip X ] [ drop Y ] if

The following two lines are equivalent:
[ ] [ ] ?if swap or


Definition

: ?if
( ..a default cond true: ( ..a cond -- ..b ) false: ( ..a default -- ..b ) -- ..b )
pick [ drop [ drop ] 2dip call ] [ 2nip call ] if ; inline