[squeak-dev] The Inbox: Collections-ael.481.mcz

Aran Lunzer aranlunzer at gmail.com
Mon Jul 30 21:57:56 UTC 2012


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 at 0.
new := orig as: Dictionary.
new at: #one put: 'bar'.
orig
---> a PluggableDictionary(#one->'bar' #two->0 at 0 )


Aran
--
Aran Lunzer
Viewpoints Research Institute


More information about the Squeak-dev mailing list