[squeak-dev] Splitting Set and Dictionary
Martin Kuball
martinkuball at web.de
Thu Nov 19 19:57:41 UTC 2009
Am Thursday 19 November 2009 schrieb Levente Uzonyi:
> Hi,
>
> I uploaded 3 packages to the inbox which add a common superclass to Set
> and Dictionary. The suggested load order is:
> 1. Collections-ul.198
> 2. Collections-ul.199
> 3. KernelTests-ul.110
>
> Loading the packages will change previous behavior in some cases:
>
> - Dictionary >> #copyWithout: doesn't raise an error anymore. Example:
> (Dictionary newFrom: { #foo -> 1. #bar -> 2 }) copyWithout: 1
> ==> a Dictionary(#bar->2 ) (instead of an error)
> - No more asymmetric set-dictionary equality. Example:
> #(1 2) asSet = (Dictionary newFrom: { #foo -> 1. #bar -> 2 })
> ==> false (instead of true)
> (Dictionary newFrom: { #foo -> 1. #bar -> 2 }) = #(1 2) asSet
> ==> false (same as before)
>
> Cheers,
> Levente
>
I wonder if we could have a mapped collection that preserves the order in
which elements are added to it. Would be nice to have this in the base
image. I used SkipList for this in older images. But since the class is
gone there is kind of a hole here.
Martin
More information about the Squeak-dev
mailing list
|