Vocabulary
sequences

Inputs
seqa sequence
na non-negative integer


Outputs
before-slicea sequence
after-slicea slice


Word description
Outputs a pair of sequences, where before consists of the first n elements of seq and has the same type, while after is a slice of the remaining elements.

Notes
Unlike cut, the run time of this word is proportional to the length of before, not after, so it is suitable for use in an iterative algorithm which cuts successive pieces off a sequence.

See also
cut, cut*

Definition


: cut-slice ( seq n -- before-slice after-slice )
[ head-slice ] [ tail-slice ] 2bi ; inline