[ Pharo 70 ] Build 83 PR 236 introduce-at-at-in-dictionary

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

[ Pharo 70 ] Build 83 PR 236 introduce-at-at-in-dictionary

Stephane Ducasse-3
Reply | Threaded
Open this post in threaded view
|

Re: [ Pharo 70 ] Build 83 PR 236 introduce-at-at-in-dictionary

Henrik-Nergaard
The Link to 236 points to something else that is not #at:at:
Why are new sub dictionaries instansiated as a normal Dictionary instead of species/class?
I would expect a sub-Dictionary be  of the same class as its parent.
Here is a test case:
----------

| dct key1 key2 subDct |

dct := IdentityDictionary new.
key1 := 'a'.
key2 := key1 copy.
dct 
  at: #a at: key1 put: 1;
  at: #a at: key2 put: 2.

subDct := dct at: #a.

TestCase new
  assert: subDct size equals: 2;
  assert: (subDct at: key1) equals: 1;
  assert: (subDct at: key2) equals: 2 
----------


Best regards,
Henrik

Fra: Pharo-dev <[hidden email]> på vegne av Stephane Ducasse <[hidden email]>
Sendt: 3. september 2017 15:56:36
Til: Pharo Development List
Emne: [Pharo-dev] [ Pharo 70 ] Build 83 PR 236 introduce-at-at-in-dictionary