[squeak-dev] Bug in SortedCollection

Ricardo Moran richi.moran at gmail.com
Tue Jul 28 21:07:58 UTC 2009


Hi, today I found this:

a := Object new -> 1.
b := Object new -> 2.
c := Object new -> 3.
d := Object new -> 4.

ss := {a. b. c.} asSortedCollection: [:a :b | a value < b value].


So far, it evaluates nicely, but when I try to do the following


ss , {d}


I get: Object doesNotUnderstand: <

Perhaps this is something you don't usually do with SortedCollections but I
don't know. I believe the problem is that OrderedCollection's implementation
of #copyReplaceFrom:to:with: creates a new collection without passing it the
sortBlock. It can be easily fixed by overriding this method in
SortedCollection and duplicating the code but I think it's ugly.
What do you think?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20090728/573ef916/attachment.htm


More information about the Squeak-dev mailing list