Handbook
Glossary
?first3 ( seq -- first/f second/f third/f )
Vocabulary
sequences
.
extras
Inputs
seq
a
sequence
Outputs
first/f
an
object
second/f
an
object
third/f
an
object
Word description
Pushes the first three elements of
seq
. Pushes
f
for missing elements.
Definition
USING:
combinators
kernel
sequences
sequences.private
;
IN:
sequences.extras
:
?first3
( seq -- first/f second/f third/f )
dup
length
{
{
0
[
drop
f
f
f
]
}
{
1
[
first-unsafe
f
f
]
}
{
2
[
first2-unsafe
f
]
}
[
drop
first3-unsafe
]
}
case
;