Vocabulary
sequences

Inputs
seqa sequence
na non-negative integer


Outputs
beforea sequence
aftera sequence


Word description
Outputs a pair of sequences, where before consists of the first n elements of seq, while after holds the remaining elements. Both output sequences have the same type as seq.

Notes
Since this word copies the entire tail of the sequence, it should not be used in a loop. If this is important, consider using cut-slice instead, since it returns a slice for the tail instead of copying.

See also
cut*, cut-slice

Definition


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