Handbook
Glossary
last ( seq -- elt )
Factor handbook
»
The language
»
Collections
»
Sequence operations
»
Accessing sequence elements
Prev:
?second ( seq -- elt/f )
Next:
?last ( seq -- elt/f )
Vocabulary
sequences
Inputs
seq
a
sequence
Outputs
elt
an
object
Word description
Outputs the last element of a sequence.
Errors
Throws an error if the sequence is empty.
See also
first
,
first2
,
last2
,
but-last
,
but-last-slice
,
rest
,
rest-slice
Definition
USING:
sequences.private
;
IN:
sequences
:
last
( seq -- elt )
index-of-last
bounds-check-head
nth-unsafe
;
inline