Richard,

The 'problem' is that the result of the (original) #reverse is a
SortedCollection without a sortBlock. Meaning it defaults to comparing
values using #<=. When a new element is added to the reversed collection it
simply assumes all elements are already sorted and uses the (default)
sortBlock to add a new element. 

I think the solution should be to have #reverse add an explicit sortBlock
which consists of reversing the original sortBlock or defaulting to [ a: b:
| (a <= b) not ]. (Keep #<= as some classes might depend on only
implementing this)

Cheers,
Erik




--
Sent from: http://forum.world.st/Pharo-Smalltalk-Users-f1310670.html

Reply via email to