3check ( ..a x y z quot: ( ..a x y z -- ..b ? ) -- ..b x y z ? )
Factor handbook » The language » Combinators » Conditional combinators

Prev:2check ( ..a x y quot: ( ..a x y -- ..b ? ) -- ..b x y ? )
Next:1guard ( ..a x quot: ( ..a x -- ..b ? ) -- ..b x/f )


Vocabulary
kernel

Inputs
xan object
yan object
zan object
quota quotation


Outputs
xan object
yan object
zan object
?a boolean


Word description
Calls quot on x, y, and z and keeps those three values under the boolean result from the quot.

Examples
True case:
USING: arrays kernel math prettyprint ; 3 4 5 [ + + even? ] 3check 4array .
{ 3 4 5 t }

False case:
USING: arrays kernel math prettyprint ; 3 4 5 [ + + odd? ] 3check 4array .
{ 3 4 5 f }


See also
1check, 1guard, 2check, 2guard, 3guard

Definition

: 3check
( ..a x y z quot: ( ..a x y z -- ..b ? ) -- ..b x y z ? )
3keep roll ; inline