Handbook
Glossary
sum-lengths ( seq -- n )
Vocabulary
sequences
Inputs
seq
a
sequence
of
sequence
s
Outputs
n
an
integer
Word description
Outputs the sum of the lengths of all sequences in
seq
.
Definition
IN:
sequences
GENERIC:
sum-lengths
( seq -- n )
Methods
USING:
kernel
math
sequences
;
M:
object
sum-lengths
0
[
length
+
]
reduce
;
USING:
accessors
kernel
math
sequences
;
M:
repetition
sum-lengths
[
length>>
]
[
elt>>
length
]
bi
*
;