sequences: implement sum on repetitions.

db4
John Benediktsson 2014-02-09 08:05:26 -08:00
parent d9961f5f4a
commit ab4a058b2c
1 changed files with 1 additions and 0 deletions

View File

@ -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 ;