Handbook
Glossary
?head-slice ( seq begin -- newseq ? )
Factor handbook
»
The language
»
Collections
»
Sequence operations
»
Splitting sequences
Prev:
?head ( seq begin -- newseq ? )
Next:
?tail ( seq end -- newseq ? )
Vocabulary
splitting
Inputs
seq
a
sequence
begin
a
sequence
Outputs
newseq
a
slice
?
a
boolean
Word description
Like
?head
, except the resulting sequence is a
slice
.
Definition
USING:
sequences
splitting.private
;
IN:
splitting
:
?head-slice
( seq begin -- newseq ? )
[
head?
]
[
tail-slice
]
?chomp
;