[squeak-dev] The Trunk: Collections-eem.803.mcz

commits at source.squeak.org commits at source.squeak.org
Wed Feb 13 01:27:38 UTC 2019


Nicolas Cellier uploaded a new version of Collections to project The Trunk:
http://source.squeak.org/trunk/Collections-eem.803.mcz

==================== Summary ====================

Name: Collections-eem.803
Author: eem
Time: 21 August 2018, 2:09:17.558296 pm
UUID: 86665c06-0176-4eb8-b9dd-2b8dc3677fd6
Ancestors: Collections-dtl.802

More rational Dictionary>>fillFrom:with: so that collect:as: Dictionary matches e.g. Dictionary withAll:

Since 2010 Dictionary withAll: { 2->3 } =>  a Dictionary(2->3 ).
But
'abc' collect: [ :each | each -> each asciiValue ] as: Dictionary => a Dictionary(1->$a->97 2->$b->98 3->$c->99 )

With this change no tests appear to break (at least none that explicitly call collect:as:) and
'abc' collect: [ :each | each -> each asciiValue ] as: Dictionary => a Dictionary($a->97 $b->98 $c->99 )

=============== Diff against Collections-dtl.802 ===============

Item was changed:
  ----- Method: Dictionary>>fillFrom:with: (in category 'private') -----
  fillFrom: aCollection with: aBlock
  	"Evaluate aBlock with each of aCollections's elements as the argument.  
  	Collect the resulting values into self. Answer self."
  
+ 	aCollection isSequenceable
+ 		ifTrue:
+ 			[aCollection associationsDo:
+ 				[ :element | self add: (aBlock value: element)]]
+ 		ifFalse:
+ 			[aCollection keysAndValuesDo:
+ 				[ :key :value | self at: key put: (aBlock value: value)]]!
- 	aCollection keysAndValuesDo: [ :key :value |
- 		self at: key put: (aBlock value: value) ]!



More information about the Squeak-dev mailing list