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
seqa sequence
firstthe 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