tail ( seq n -- tailseq )
Factor handbook > The language > Collections > Sequence operations > Subsequences and slices

Prev:head ( seq n -- headseq )
Next:head* ( seq n -- headseq )


Vocabulary
sequences

Inputs and outputs
seqa sequence
na non-negative integer
tailseqa new sequence


Word description
Outputs a new sequence consisting of the input sequence with the first n items removed.

Examples
USING: sequences prettyprint ; { 1 2 3 4 5 6 7 } 2 tail .
{ 3 4 5 6 7 }

When a sequence may not have enough elements:
USING: sequences prettyprint ; { 1 2 } 5 short tail .
{ }


Errors
Throws an error if the index is out of bounds.

See also
tail*, tail-slice, tail-slice*

Definition