3when ( ..a x y z pred: ( ..a x y z -- ..b ? ) true: ( ..b x y z -- ..b x y z ) -- ..b x y x )


Vocabulary
kernel

Inputs
xan object
yan object
zan object
preda quotation
truea quotation


Outputs
xan object
yan object


Word description
A variant of when that takes a pred quotation. Calls 3check on the pred quotation to return a boolean and preserves x, y, and z for both branches. The true branch is called conditionally.

See also
1if, 1when, 1unless, 2if, 2when, 2unless, 3if, 3unless

Definition

: 3when
( ..a x y z pred: ( ..a x y z -- ..b ? ) true: ( ..b x y z -- ..b x y z ) -- ..b x y x )
[ ] 3if ; inline