Handbook
Glossary
first3 ( seq -- first second third )
Factor handbook
»
The language
»
Collections
»
Sequence operations
»
Accessing sequence elements
Prev:
first2 ( seq -- first second )
Next:
first4 ( seq -- first second third fourth )
Vocabulary
sequences
Inputs
seq
a
sequence
Outputs
first
the first element
second
the second element
third
the third element
Word description
Pushes the first three elements of a sequence.
Errors
Throws an error if the sequence has less than three elements.
Definition
USING:
kernel
sequences.private
;
IN:
sequences
:
first3
( seq -- first second third )
2
swap
bounds-check
nip
first3-unsafe
;
inline