head-slice* ( seq n -- slice )
Factor handbook > The language > Collections > Sequence operations > Subsequences and slices

Prev:tail-slice ( seq n -- slice )
Next:tail-slice* ( seq n -- slice )


Vocabulary
sequences

Inputs and outputs
seqa sequence
na non-negative integer
slicea slice


Word description
Outputs a virtual sequence sharing storage with all elements of seq until the nth element from the end. In other words, it outputs a sequence of the first l-n elements of the input sequence, where l is its length.

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

See also
head, head*, head-slice

Definition