Handbook
Glossary
unclip-last-slice ( seq -- butlast-slice last )
Factor handbook
»
The language
»
Collections
»
Sequence operations
»
Subsequences and slices
Prev:
unclip-slice ( seq -- rest-slice first )
Next:
cut-slice ( seq n -- before-slice after-slice )
Vocabulary
sequences
Inputs
seq
a
sequence
Outputs
butlast-slice
a
slice
last
an
object
Word description
Outputs a head sequence and the last element of
seq
; the head sequence consists of all elements of
seq
but the last. Unlike
unclip-last
, this word does not make a copy of the input sequence, and runs in constant time.
See also
unclip
,
unclip-slice
,
unclip-last
Definition
USING:
kernel
sequences.private
;
IN:
sequences
:
unclip-last-slice
( seq -- butlast-slice last )
[
but-last-slice
]
[
last-unsafe
]
bi
;
inline