Handbook
Glossary
?second ( seq -- elt/f )
Factor handbook
»
The language
»
Collections
»
Sequence operations
»
Accessing sequence elements
Prev:
?first ( seq -- elt/f )
Next:
last ( seq -- elt )
Vocabulary
sequences
Inputs
seq
a
sequence
Outputs
elt/f
an
object
or
f
Word description
A forgiving version of
second
. If the sequence has less than two elements, or if the sequence is
f
, simply outputs
f
.
Definition
USING:
kernel
;
IN:
sequences
:
?second
( seq -- elt/f )
1
swap
?nth
;
inline