subseq ( from to seq -- subseq )
Factor handbook » The language » Collections » Sequence operations » Subsequences and slices

Next:subseq-as ( from to seq exemplar -- subseq )


Vocabulary
sequences

Inputs
froma non-negative integer
toa non-negative integer
seqa sequence


Outputs
subseqa new sequence


Word description
Outputs a new sequence consisting of all elements starting from and including from, and up to but not including to.

Errors
Throws an error if from or to is out of bounds.

See also
<slice>

Definition


: subseq ( from to seq -- subseq ) dup subseq-as ;