but-last ( seq -- headseq )
Factor handbook » The language » Collections » Sequence operations » Subsequences and slices

Prev:rest ( seq -- tailseq )
Next:unclip ( seq -- rest first )


Vocabulary
sequences

Inputs
seqa sequence


Outputs
headseqa new sequence


Word description
Outputs a new sequence consisting of the input sequence with the last item removed.

Errors
Throws an error on an empty sequence.

See also
first, first2, last, last2, but-last-slice, rest, rest-slice

Definition

: but-last ( seq -- headseq ) 1 head* ;