insert-nth ( elt n seq -- seq' )
Factor handbook » The language » Collections » Sequence operations » Adding and removing sequence elements

Prev:suffix ( seq elt -- newseq )
Next:remove ( elt seq -- newseq )


Vocabulary
sequences

Inputs
eltan object
nan integer
seqa sequence


Outputs
seq'a sequence


Word description
Creates a new sequence where the nth index is set to the input object.

Examples
USING: prettyprint sequences ; 40 3 { 10 20 30 50 } insert-nth .
{ 10 20 30 40 50 }


Definition