The Inbox: Collections-ael.481.mcz

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

The Inbox: Collections-ael.481.mcz

Aran Lunzer-2
This is a proposed fix for the following behaviour:

Creating a Dictionary (or subclass) using newFrom: another dictionary,
or as:, reuses the associations from the original collection.  Thus
some updates to the new collection affect the old, and vice versa.

Example using #as:

orig := PluggableDictionary new.
orig at: #one put: 'foo'; at: #two put: 0@0.
new := orig as: Dictionary.
new at: #one put: 'bar'.
---> a PluggableDictionary(#one->'bar' #two->0@0 )

Aran Lunzer
Viewpoints Research Institute