delete-all ( seq -- )
Factor documentation > Factor handbook > The language > Collections > Sequence operations > Destructive sequence operations
Prev:delete-slice ( from to seq -- )
Next:filter! ( ... seq quot: ( ... elt -- ... ? ) -- ... seq )


Vocabulary
sequences

Inputs and outputs
seqa resizable sequence


Word description
Resizes the sequence to zero length, removing all elements. Not all sequences are resizable.

Errors
Throws a bounds-error if the new length is negative, or if the sequence is not resizable.

Side effects
Modifies seq

Definition
USING: kernel ;

IN: sequences

: delete-all ( seq -- ) 0 swap set-length ;