Handbook
Glossary
find-index-from ( ... n seq quot: ( ... elt i -- ... ? ) -- ... i elt )
Vocabulary
sequences
Inputs
n
a starting index
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-from
where the quotation takes both an element and its index.The search starts from list index
n
, skipping elements up until that index.
Definition
USING:
kernel
math
sequences.private
;
IN:
sequences
:
find-index-from
( ... n seq quot: ( ... elt i -- ... ? ) -- ... i elt )
[
[
sequence-index-operator
find-integer-from
]
keepd
index/element
]
curry
bounds-check-call
;
inline