sequences: implement sum on repetitions.
parent
d9961f5f4a
commit
ab4a058b2c
|
@ -1017,6 +1017,7 @@ PRIVATE>
|
|||
GENERIC: sum ( seq -- n )
|
||||
M: object sum 0 [ + ] binary-reduce ; inline
|
||||
M: iota-tuple sum length dup 1 - * 2/ ; inline
|
||||
M: repetition sum [ elt>> ] [ len>> ] bi * ; inline
|
||||
|
||||
: product ( seq -- n ) 1 [ * ] binary-reduce ;
|
||||
|
||||
|
|
Loading…
Reference in New Issue