Handbook
Glossary
unclip-slice ( seq -- rest-slice first )
Factor handbook
»
The language
»
Collections
»
Sequence operations
»
Subsequences and slices
Prev:
but-last-slice ( seq -- slice )
Next:
unclip-last-slice ( seq -- butlast-slice last )
Vocabulary
sequences
Inputs
seq
a
sequence
Outputs
rest-slice
a
slice
first
an
object
Word description
Outputs a tail sequence and the first element of
seq
; the tail sequence consists of all elements of
seq
but the first. Unlike
unclip
, this word does not make a copy of the input sequence, and runs in constant time.
Examples
USING: math.order prettyprint sequences ; { 3 -1 -10 5 7 } unclip-slice [ min ] reduce .
-10
See also
unclip
,
unclip-last
,
unclip-last-slice
Definition
USING:
kernel
sequences.private
;
IN:
sequences
:
unclip-slice
( seq -- rest-slice first )
[
rest-slice
]
[
first-unsafe
]
bi
;
inline