Vocabulary
sequences

Inputs
seqa sequence
na non-negative integer


Outputs
headseqa new sequence


Word description
Outputs a new sequence consisting of all elements of seq until the n th element from the end. In other words, it removes the last n elements.

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

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


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

See also
head, head-slice, head-slice*

Definition