[Pkg] The Trunk: Collections-fbs.456.mcz
commits at source.squeak.org
commits at source.squeak.org
Fri Sep 9 11:00:40 UTC 2011
Levente Uzonyi uploaded a new version of Collections to project The Trunk:
http://source.squeak.org/trunk/Collections-fbs.456.mcz
==================== Summary ====================
Name: Collections-fbs.456
Author: fbs
Time: 9 September 2011, 11:51:06.387 am
UUID: a66665f4-54c0-4023-b9cd-ba67db31fdc9
Ancestors: Collections-eem.455
Mantis #7666: typo in Dictionary class >> #newFromPairs.
=============== Diff against Collections-eem.455 ===============
Item was changed:
----- Method: Dictionary class>>newFromPairs: (in category 'instance creation') -----
newFromPairs: anArray
+ "Answer an instance of me associating (anArray at:i) to (anArray at: i+1)
- "Answer an instance of me associating (anArray at:i) to (anArray at: i+i)
for each odd i. anArray must have an even number of entries."
| newDictionary |
newDictionary := self new: (anArray size/2).
1 to: (anArray size-1) by: 2 do: [ :i|
newDictionary at: (anArray at: i) put: (anArray at: i+1).
].
^ newDictionary
" Dictionary newFromPairs: {'Red' . Color red . 'Blue' . Color blue . 'Green' . Color green}. "!
More information about the Packages
mailing list