circular-clumps
Factor documentation > Factor handbook > The language > Collections > Sequence operations > Groups and clumps
Prev:<clumps> ( seq n -- clumps )
Next:<circular-clumps> ( seq n -- clumps )


Vocabulary
grouping

Class description
Instances are virtual sequences whose elements are overlapping fixed-length subsequences of an underlying sequence, beginning with every element in the original sequence and wrapping around its end. Circular clumps are mutable and resizable if the underlying sequence is mutable and resizable, respectively.

New clumps are created by calling <circular-clumps>.

See also
clumps, groups

Definition
USING: grouping.private ;

IN: grouping

TUPLE: circular-clumps < chunking-seq ;


Methods
USING: accessors grouping sequences ;

M: circular-clumps length seq>> length ; inline


USING: accessors grouping kernel math sequences ;

M: circular-clumps nth
[ n>> over + ] [ seq>> ] bi <circular-slice> ; inline