Handbook
Glossary
remove-nth! ( n seq -- seq )
Factor handbook
»
The language
»
Collections
»
Sequence operations
»
Destructive sequence operations
Prev:
remove-eq! ( elt seq -- seq )
Next:
delete-slice ( from to seq -- )
Vocabulary
sequences
Inputs
n
a non-negative integer
seq
a resizable mutable sequence
Outputs
seq
a resizable mutable sequence
Word description
Removes the
n
th element from the sequence, shifting all other elements down and reducing its length by one.
Notes
The sequence
seq
MUST be growable. See
Resizable sequence implementation
.
Side effects
Modifies
seq
See also
remove
,
remove-nth
,
remove-eq
,
remove-eq!
,
remove!
Definition
USING:
kernel
math
;
IN:
sequences
:
remove-nth!
( n seq -- seq )
[
[
dup
1
+
]
dip
delete-slice
]
keep
;