The Trunk: Collections-ul.199.mcz

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

The Trunk: Collections-ul.199.mcz

commits-2
Andreas Raab uploaded a new version of Collections to project The Trunk:
http://source.squeak.org/trunk/Collections-ul.199.mcz

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

Name: Collections-ul.199
Author: ul
Time: 19 November 2009, 1:49:03 am
UUID: 1f413b65-3cdd-4047-95e8-6025ff91aa49
Ancestors: Collections-ul.198

Dictionary is not a Set anymore.
- Removed Dictionary >> #asSet, because it's same as in super.
- Added a super send to Dictionary >> #postCopy.
- Moved #occurencesOf: and #postCopy back to Set from HashedCollection.

=============== Diff against Collections-ul.198 ===============

Item was changed:
+ HashedCollection subclass: #Dictionary
- Set subclass: #Dictionary
  instanceVariableNames: ''
  classVariableNames: ''
  poolDictionaries: ''
  category: 'Collections-Unordered'!
 
  !Dictionary commentStamp: '<historical>' prior: 0!
  I represent a set of elements that can be viewed from one of two perspectives: a set of associations, or a container of values that are externally named where the name can be any object that responds to =. The external name is referred to as the key.  I inherit many operations from Set.!

Item was added:
+ ----- Method: Set>>postCopy (in category 'copying') -----
+ postCopy
+ super postCopy.
+ array := array copy!

Item was added:
+ ----- Method: Set>>occurrencesOf: (in category 'testing') -----
+ occurrencesOf: anObject
+ ^ (self includes: anObject) ifTrue: [1] ifFalse: [0]!

Item was changed:
  ----- Method: Dictionary>>postCopy (in category 'copying') -----
  postCopy
  "Must copy the associations, or later store will affect both the
  original and the copy"
 
+ super postCopy.
  array := array collect: [ :association |
  association ifNotNil: [ association copy ] ]!

Item was removed:
- ----- Method: Dictionary>>asSet (in category 'converting') -----
- asSet
- "Though implemented as a subclass of Set for conveniency, a Dictionary is not a Set.
- It has to be converted, like super super implementation."
-
- ^Set withAll: self!

Item was removed:
- ----- Method: HashedCollection>>postCopy (in category 'copying') -----
- postCopy
- super postCopy.
- array := array copy!

Item was removed:
- ----- Method: HashedCollection>>occurrencesOf: (in category 'testing') -----
- occurrencesOf: anObject
- ^ (self includes: anObject) ifTrue: [1] ifFalse: [0]!