when ( ..a ? true: ( ..a -- ..a ) -- ..a ) (original) (raw)

Vocabulary
kernel

Inputs

? a generalized boolean
true a quotation

Outputs
None

Word description
If cond is not f, calls the true quotation.

The cond value is removed from the stack before the quotation is called.

Examples

USING: kernel math prettyprint ; -5 dup 0 < [ 3 + ] when .
-2

Definition

IN: kernel

: when ( ..a ? true: ( ..a -- ..a ) -- ..a ) [ ] if ; inline