Factor Documentation
|
Home
|
Glossary
|
Search
factorcode.org
find-last ( ... seq quot: ( ... elt -- ... ? ) -- ... i elt )
Factor handbook
>
The language
>
Collections
>
Sequence operations
>
Searching sequences
Prev:
find-from ( ... n seq quot: ( ... elt -- ... ? ) -- ... i elt )
Next:
find-last-from ( ... n seq quot: ( ... elt -- ... ? ) -- ... i elt )
Vocabulary
sequences
Inputs and outputs
seq
a
sequence
quot
a
quotation
with stack effect
( ... elt -- ... ? )
i
the index of the first match or
f
elt
the first matching element or
f
Word description
A simpler variant of
find-last-from
where the starting index is one less than the length of the sequence.
See also
find
,
find-from
,
find-last-from
,
search
Definition
USING:
kernel
math
sequences.private
;
IN:
sequences
:
find-last
( ... seq quot: ( ... elt -- ... ? ) -- ... i elt )
[
[
1
-
]
dip
find-last-integer
]
(find)
;
inline