all-integers-from? ( ... from to quot: ( ... i -- ... ? ) -- ... ? )


Vocabulary
math

Inputs
froman integer
toan integer
quota quotation


Outputs
?a boolean


Word description
Applies the quotation to each integer in [from..to), returning t if all results are true, and f otherwise.

Definition


: all-integers-from?
( ... from to quot: ( ... i -- ... ? ) -- ... ? )
2over < [
[ nip call ] 3keep roll
[ [ 1 + ] 2dip all-integers-from? ] [ 3drop f ] if
] [ 3drop t ] if ; inline recursive