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