Handbook
Glossary
index-from ( obj i seq -- n )
Factor handbook
»
The language
»
Collections
»
Sequence operations
»
Searching sequences
Prev:
index ( obj seq -- n )
Next:
last-index ( obj seq -- n )
Vocabulary
sequences
Inputs
obj
an
object
i
a start index
seq
a
sequence
Outputs
n
an index
Word description
Outputs the index of the first element in the sequence equal to
obj
, starting the search from the
i
th element. If no element is found, outputs
f
.
See also
index
,
last-index
,
last-index-from
,
sorted-index
Definition
USING:
kernel
;
IN:
sequences
:
index-from
( obj i seq -- n )
rot
[
=
]
curry
find-from
drop
;