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