Handbook
Glossary
groups
Factor handbook
»
The language
»
Collections
»
Sequence operations
»
Groups and clumps
Prev:
group ( seq n -- array )
Next:
<groups> ( seq n -- groups )
Vocabulary
grouping
Class description
Instances are virtual sequences whose elements are disjoint fixed-length subsequences of an underlying sequence. Groups are mutable and resizable if the underlying sequence is mutable and resizable, respectively.
New groups are created by calling
<groups>
.
See also
clumps
,
circular-clumps
Definition
USING:
grouping.private
;
IN:
grouping
TUPLE:
groups
<
chunking
;
Methods
USING:
accessors
grouping
grouping.private
kernel
math
math.order
sequences
;
M:
groups
group@
[
n>>
[
*
dup
]
keep
+
]
[
seq>>
]
bi
[
length
min
]
keep
;
inline
USING:
accessors
grouping
kernel
math
sequences
;
M:
groups
length
[
seq>>
length
]
[
n>>
]
bi
[
+
1
-
]
keep
/i
;
inline
USING:
accessors
grouping
kernel
math
sequences
;
M:
groups
set-length
[
n>>
*
]
[
seq>>
]
bi
set-length
;
inline