new-sequence ( len seq -- newseq )
Factor handbook > The language > Collections > Sequence operations > Sequence protocol

Prev:like ( seq exemplar -- newseq )
Next:new-resizable ( len seq -- newseq )


Vocabulary
sequences

Inputs and outputs
lena non-negative integer
seqa sequence
newseqa mutable sequence


Generic word contract
Outputs a mutable sequence of length len which can hold the elements of seq. The initial contents of the sequence are undefined.

Definition


Methods



















M:: appender new-sequence ( len inserter -- newseq )
inserter underlying>> :> underlying underlying length
:> old-length old-length len +
:> new-length new-length underlying set-length
underlying old-length <offset-growable> ; inline