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