#REFACTORING by stefan
class: MethodDictionary
added: #speciesForCollecting
removed: #collect:
use inherited method from Collection
--- a/MethodDictionary.st Fri Jan 20 19:54:34 2017 +0100
+++ b/MethodDictionary.st Fri Jan 20 19:55:46 2017 +0100
@@ -235,22 +235,6 @@
!MethodDictionary methodsFor:'enumerating'!
-collect:aBlock
- "for each element in the receiver, evaluate the argument, aBlock
- and return a Bag with the results."
-
- |newCollection|
-
- newCollection := Bag new.
- self do:[:value |
- newCollection add:(aBlock value:value)
- ].
- ^ newCollection
-
- "Created: / 24-06-1996 / 17:41:41 / cg"
- "Modified: / 08-08-2006 / 16:12:04 / cg"
-!
-
do:aBlock
"evaluate aBlock for each value (i.e. each method)"
@@ -330,6 +314,12 @@
"return the number of elements (associations) in the receiver"
^ self basicSize // 2
+!
+
+speciesForCollecting
+ ^ Bag
+
+ "Created: / 20-01-2017 / 18:07:53 / stefan"
! !
!MethodDictionary methodsFor:'removing'!