Factor Documentation
|
Home
|
Glossary
|
Search
factorcode.org
first ( seq -- first )
Factor documentation
>
Factor handbook
>
The language
>
Collections
>
Sequence operations
>
Accessing sequence elements
Prev:
?nth ( n seq -- elt/f )
Next:
second ( seq -- second )
Vocabulary
sequences
Inputs and outputs
seq
a
sequence
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.
Definition
USING:
kernel
;
IN:
sequences
:
first
( seq -- first )
0
swap
nth
;
inline