Handbook
Glossary
repetition
Factor handbook
»
The language
»
Collections
»
Sequence operations
»
Reshaping sequences
Next:
<repetition> ( len elt -- repetition )
Vocabulary
sequences
Class description
A virtual sequence consisting of
elt
repeated
len
times. Repetitions are created by calling
<repetition>
.
Definition
USING:
math
;
IN:
sequences
TUPLE:
repetition
{
length
integer
read-only
initial:
0
}
{
elt
read-only
}
;
Methods
USING:
accessors
sequences
;
M:
repetition
length
length>>
;
inline
USING:
accessors
sequences
;
M:
repetition
maximum
elt>>
;
inline
USING:
accessors
sequences
;
M:
repetition
minimum
elt>>
;
inline
USING:
accessors
kernel
sequences
sequences.private
;
M:
repetition
nth-unsafe
nip
elt>>
;
inline
USING:
accessors
kernel
math
sequences
;
M:
repetition
sum
[
elt>>
]
[
length>>
]
bi
*
;
inline
USING:
accessors
kernel
math
sequences
;
M:
repetition
sum-lengths
[
length>>
]
[
elt>>
length
]
bi
*
;