prepend ( seq1 seq2 -- newseq )
Factor handbook > The language > Collections > Sequence operations > Appending sequences

Prev:append-as ( seq1 seq2 exemplar -- newseq )
Next:3append ( seq1 seq2 seq3 -- newseq )


Vocabulary
sequences

Inputs and outputs
seq1a sequence
seq2a sequence
newseqa sequence


Word description
Outputs a new sequence of the same type as seq1 consisting of the elements of seq2 followed by seq1.

Errors
Throws an error if seq2 contains elements not permitted in sequences of the same class as seq1.

Examples
USING: prettyprint sequences ; { 1 2 } B{ 3 4 } prepend .
{ 3 4 1 2 }

USING: prettyprint sequences strings ; "go" "car" prepend .
"cargo"


See also
prepend-as

Definition