Handbook
Glossary
cut* ( seq n -- before after )
Factor handbook
»
The language
»
Collections
»
Sequence operations
»
Subsequences and slices
Prev:
cut ( seq n -- before after )
Next:
slice
Vocabulary
sequences
Inputs
seq
a
sequence
n
a non-negative integer
Outputs
before
a
sequence
after
a
sequence
Word description
Outputs a pair of sequences, where
after
consists of the last
n
elements of
seq
, while
before
holds the remaining elements. Both output sequences have the same type as
seq
.
See also
cut
,
cut-slice
,
cut-slice*
Definition
USING:
kernel
;
IN:
sequences
:
cut*
( seq n -- before after )
[
head*
]
[
tail*
]
2bi
;