join-as ( seq glue exemplar -- newseq )
Factor handbook » The language » Collections » Sequence operations » Appending sequences

Prev:join ( seq glue -- newseq )
Next:pad-head ( seq n elt -- padded )


Vocabulary
sequences

Inputs
seqa sequence
gluea sequence
exemplara sequence


Outputs
newseqa sequence


Word description
Concatenates a sequence of sequences together into one sequence, placing a copy of glue between each pair of sequences. The resulting sequence is of the same class as glue.

Notes
If the glue sequence is empty, this word calls concat-as.

Examples
Join a list of strings as a string buffer:
USING: sequences prettyprint ; { "a" "b" "c" } "1" SBUF" " join-as .
SBUF" a1b1c"


Errors
Throws an error if one of the sequences in seq contains elements not permitted in sequences of the same class as exemplar.

See also
join, concat, concat-as

Definition