The Trunk: Collections-cbc.689.mcz

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

The Trunk: Collections-cbc.689.mcz

commits-2
David T. Lewis uploaded a new version of Collections to project The Trunk:
http://source.squeak.org/trunk/Collections-cbc.689.mcz

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

Name: Collections-cbc.689
Author: cbc
Time: 13 April 2016, 3:28:58.221861 pm
UUID: 84ae8fa7-91ee-4f47-8bdf-eadcac286a1e
Ancestors: Collections-mt.688

Fix comment in Dictioanry class>>newFrom: so that the examples actually work.

=============== Diff against Collections-mt.688 ===============

Item was changed:
  ----- Method: Dictionary class>>newFrom: (in category 'instance creation') -----
  newFrom: aDict
  "Answer an instance of me containing the same associations as aDict.
  Error if any key appears twice."
  | newDictionary |
  newDictionary := self new: aDict size.
  aDict associationsDo:
  [:x |
  (newDictionary includesKey: x key)
  ifTrue: [self error: 'Duplicate key: ', x key printString]
  ifFalse: [newDictionary add: x copy]].
  ^ newDictionary
 
+ " Dictionary newFrom: {1->#a. 2->#b. 3->#c}
+ {1->#a. 2->#b. 3->#c} as: Dictionary
+ Dictionary newFrom: {1->#a. 2->#b. 1->#c}
+ {1->#a. 2->#b. 1->#c} as: Dictionary
- " NewDictionary newFrom: {1->#a. 2->#b. 3->#c}
- {1->#a. 2->#b. 3->#c} as: NewDictionary
- NewDictionary newFrom: {1->#a. 2->#b. 1->#c}
- {1->#a. 2->#b. 1->#c} as: NewDictionary
  "!


Reply | Threaded
Open this post in threaded view
|

Re: The Trunk: Collections-cbc.689.mcz

marcel.taeumel
+1