like ( seq exemplar -- newseq )
Factor handbook > The language > Collections > Sequence operations > Sequence protocol

Prev:lengthen ( n seq -- )
Next:new-sequence ( len seq -- newseq )


Inputs and outputs
seqa sequence
exemplara sequence
newseqa new sequence

Generic word contract
Outputs a sequence with the same elements as seq, but like the template sequence, in the sense that it either has the same class as the template sequence, or if the template sequence is a virtual sequence, the same class as the template sequence's underlying sequence.

The default implementation does nothing.

Unlike clone-like, the output sequence might share storage with the input sequence.


GENERIC: like ( seq exemplar -- newseq ) flushable