Handbook
Glossary
nth* ( n seq -- elt )
Vocabulary
sequences
.
extras
Inputs
n
an
integer
seq
a
sequence
Outputs
elt
an
object
Word description
Pushes the nth element of the sequence if it exists, otherwise pushes sequence length - 1.
Definition
USING:
kernel
math
sequences
;
IN:
sequences.extras
:
nth*
( n seq -- elt )
[
length
1
-
swap
-
]
[
nth
]
bi
;
inline