--- a/Collection.st Mon Jan 26 15:42:58 2009 +0100
+++ b/Collection.st Thu Jan 29 21:21:46 2009 +0100
@@ -228,7 +228,6 @@
^ self withSize:n
! !
-
!Collection class methodsFor:'Signal constants'!
emptyCollectionSignal
@@ -384,7 +383,6 @@
].
! !
-
!Collection methodsFor:'accessing'!
anElement
@@ -1013,12 +1011,7 @@
!Collection methodsFor:'bulk operations'!
product
- "sum up all elements.
- This is implemented using a variant of the normal inject:into: pattern.
- The reason for this is that it is not known whether we're in the normal
- number line, i.e. whether 0 is a good initial value for the sum.
- Consider a collection of measurement objects, 0 would be the unitless
- value and would not be appropriate to add with the unit-ed objects."
+ "multiply up all elements."
self emptyCheck.
^ self
@@ -1035,12 +1028,7 @@
!
sum
- "sum up all elements.
- This is implemented using a variant of the normal inject:into: pattern.
- The reason for this is that it is not known whether we are dealing with number
- (i.e. if 0 is a good initial value for the sum).
- Consider a collection of measurement or physical objects, 0 would be the unitless
- value and would not be appropriate to add with the unit-ed objects."
+ "sum up all elements; return 0 for an empty collection."
self isEmpty ifTrue:[^ 0].
@@ -3340,7 +3328,7 @@
!Collection class methodsFor:'documentation'!
version
- ^ '$Header: /cvs/stx/stx/libbasic/Collection.st,v 1.217 2009-01-22 20:24:47 cg Exp $'
+ ^ '$Header: /cvs/stx/stx/libbasic/Collection.st,v 1.218 2009-01-29 20:21:46 cg Exp $'
! !
Collection initialize!