prefix ( seq elt -- newseq )
Factor handbook » The language » Collections » Sequence operations » Adding and removing sequence elements

Next:suffix ( seq elt -- newseq )


Vocabulary
sequences

Inputs
seqa sequence
eltan object


Outputs
newseqa sequence


Word description
Outputs a new sequence obtained by adding elt at the beginning of seq.

Errors
Throws an error if the type of elt is not permitted in sequences of the same class as seq1.

Examples
USING: prettyprint sequences ; { 1 2 3 } 0 prefix .
{ 0 1 2 3 }


See also
push, push-either, push-when, pop, pop*, suffix, suffix!

Definition