cut-slice* ( seq n -- before-slice after-slice )


Vocabulary
sequences

Inputs
seqa sequence
na non-negative integer


Outputs
before-slicea slice
after-slicea slice


Word description
Outputs a pair of sequences, where after consists of the last n elements of seq, while before-slice is a slice of the remaining elements.

Notes
Unlike cut*, this is suitable for use in an iterative algorithm which cuts successive pieces off a sequence.

See also
cut, cut*, cut-slice

Definition


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