On Dec 23, 2009, at 10:57 PM, Martin McClure wrote:
Stéphane Ducasse wrote:
Not all collections are sortable and #sort: is sorting in-place, so it's hardly doable.
But it would be nice to have sort: and sortBlock: polymorph. Because right now we cannot have OrderedCollection and Array or SortedCollection interchanged.
OrderedCollection, Array, and SortedCollection by design all have different semantics, not just different internal implementations. In such a case you cannot expect to be able to interchange them in all circumstances.
sure but when I know what I'm doing iterating for example I should be able and sorting them before iterating is a good motivation to iterate on them.
In many cases you can, but when for instance you use #sortBlock: you'd better not have an Array or OrderedCollection, and when you use #add: you'd better not have an Array, because those classes do not support the *meanings* of those selectors.
Yes I know :) Now not having sort in SortedCollection is a lack of vision. Stef