Handbook
Glossary
<circular-clumps> ( seq n -- clumps )
Factor handbook
»
The language
»
Collections
»
Sequence operations
»
Groups and clumps
Prev:
circular-clumps
Next:
monotonic? ( seq quot: ( elt1 elt2 -- ? ) -- ? )
Vocabulary
grouping
Inputs
seq
a
sequence
n
a non-negative integer
Outputs
clumps
a
clumps
Word description
Outputs a virtual sequence whose elements are overlapping slices of
n
elements from the underlying sequence, starting with each of its elements and wrapping around the end of the sequence.
Examples
USING: arrays kernel sequences grouping prettyprint ; { 1 2 3 4 } 3 <circular-clumps> third >array .
{ 3 4 1 }
See also
<clumps>
,
<groups>
Definition
USING:
grouping.private
;
IN:
grouping
:
<circular-clumps>
( seq n -- clumps )
circular-clumps
new-groups
;
inline