2check ( ..a x y quot: ( ..a x y -- ..b ? ) -- ..b x y ? ) (original) (raw)

Vocabulary
kernel

Inputs

x an object
y an object
quot a quotation

Outputs

x an object
y an object
? a boolean

Word description
Calls quot on x and y 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

IN: kernel

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