2all? ( ... seq1 seq2 quot: ( ... elt1 elt2 -- ... ? ) -- ... ? )
Factor handbook » The language » Collections » Sequence operations » Sequence combinators » Pair-wise sequence combinators

Prev:2map-reduce ( ..a seq1 seq2 map-quot: ( ..a elt1 elt2 -- ..a intermediate ) reduce-quot: ( ..a prev intermediate -- ..a next ) -- ..a result )


Vocabulary
sequences

Inputs
seq1a sequence
seq2a sequence
quota quotation with stack effect ( ... elt1 elt2 -- ... ? )


Outputs
?a boolean


Word description
Tests if all pairwise elements of seq1 and seq2 fulfill the predicate. If the sequences have different lengths, then only the smallest sequences items are compared with the other.

Examples
USING: math prettyprint sequences ; { 1 2 3 4 } { 2 4 6 8 } [ <= ] 2all? .
t


Definition


: 2all?
( ... seq1 seq2 quot: ( ... elt1 elt2 -- ... ? ) -- ... ? )
2length-operator all-integers? ; inline