Handbook
Glossary
find-index ( ... seq quot: ( ... elt i -- ... ? ) -- ... i elt )
Vocabulary
sequences
Inputs
seq
a
sequence
quot
a
quotation
with stack effect
( ... elt i -- ... ? )
Outputs
i
the index of the first match or
f
elt
the first matching element or
f
Word description
A variant of
find
where the quotation takes both an element and its index.
Definition
USING:
kernel
;
IN:
sequences
:
find-index
( ... seq quot: ( ... elt i -- ... ? ) -- ... i elt )
[
0
]
2dip
find-index-from
;
inline