Factor Documentation
|
Home
|
Glossary
|
Search
factorcode.org
find-index-from ( ... n seq quot: ( ... elt i -- ... ? ) -- ... i elt )
Vocabulary
sequences
Inputs and outputs
n
a starting index
seq
a
sequence
quot
a
quotation
with stack effect
( ... elt i -- ... ? )
i
the index of the first match, or
f
elt
the first matching element, or
f
Word description
A varient of
find-from
where the quotation takes both an element and its index.
Definition
USING:
math
sequences.private
;
IN:
sequences
:
find-index-from
( ... n seq quot: ( ... elt i -- ... ? ) -- ... i elt )
[
(find-integer)
]
(find-index-from)
;
inline