each-integer ( ... n quot: ( ... i -- ... ) -- ... ) (original) (raw)

each-integer ( ... n quot: ( ... i -- ... ) -- ... )

Vocabulary
math

Inputs

n an integer
quot a quotation with stack effect ( ... i -- ... )

Outputs
None

Word description
Applies the quotation to each integer from 0 up to n, excluding n.

Notes
This word is used to implement each.

Definition

USING: kernel ;

IN: math

: each-integer ( ... n quot: ( ... i -- ... ) -- ... )
[ 0 ] 2dip each-integer-from ; inline