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
lena non-negative integer
seqa sequence


Outputs
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.

Examples
USING: prettyprint sequences ; 6 { 1 2 3 } new-sequence .
{ 0 0 0 0 0 0 }


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