Handbook
Glossary
each-index-from ( ... seq quot: ( ... elt index -- ... ) i -- ... )
Vocabulary
sequences
.
extras
Inputs
seq
a
sequence
quot
a
quotation
with stack effect
( ... elt index -- ... )
i
a starting index
Outputs
None
Word description
Calls the quotation with the element of the sequence and its index on the stack, with the index on the top of the stack, from a starting index.
Examples
USING: arrays sequences.extras prettyprint ; { 10 20 30 } [ 2array . ] 1 each-index-from
{ 20 1 } { 30 2 }
Definition
USING:
kernel
math
sequences.private
;
IN:
sequences.extras
:
each-index-from
( ... seq quot: ( ... elt index -- ... ) i -- ... )
-rot
sequence-index-operator
each-integer-from
;
inline