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

Prev:1check ( ..a x quot: ( ..a x -- ..b ? ) -- ..b x ? )
Next:3check ( ..a x y z quot: ( ..a x y z -- ..b ? ) -- ..b x y z ? )


Vocabulary
kernel

Inputs
xan object
yan object
quota quotation


Outputs
xan object
yan object
?a boolean


Word description
Calls quot on x and x and keeps those two values under the boolean result from the quot.

Examples
True case:
USING: kernel math prettyprint ; 3 4 [ + odd? ] 2check [ . ] tri@
3 4 t

False case:
USING: kernel math prettyprint ; 3 4 [ + even? ] 2check [ . ] tri@
3 4 f


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

Definition

: 2check ( ..a x y quot: ( ..a x y -- ..b ? ) -- ..b x y ? )
2keep rot ; inline