VocabularykernelInputsOutputsNone
Word descriptionIf
cond is
f, calls the
false quotation. Otherwise calls the
true quotation.
The
cond value is removed from the stack before either quotation is called.
ExamplesUSING: io kernel math ;
10 3 < [ "Math is broken" print ] [ "Math is good" print ] if
Math is good
Notesif is executed as a primitive when preceded by two literal quotations. The below definition is not executed unless one of its arguments is a non-literal quotation, such as a quotation constructed with
curry or
compose, or for
Fried quotations or quotations including
Lexical variables.
Definition