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