[Seaside-dev] Re: [Seaside Commits] Seaside 3.0:
Grease-Pharo-Core-lr.15.mcz
Paolo Bonzini
bonzini at gnu.org
Wed Mar 31 10:31:31 UTC 2010
On 03/31/2010 12:24 PM, Julian Fitzell wrote:
>>>> >>> sorted: sortBlock
>>>> >>> + ^ self sortBy: sortBlock!
>>>> >>> - ^ (self sortBy: sortBlock) as: self species!
>> >
>> > #species of SortedCollection is SortedCollection. Sorting a
>> > SortedCollection with a non-default sortBlock, but then the collection
>> > is converted to a SortedCollection with a default sort block, what
>> > gives the default sorting.
>> >
>> > I don't know if it is correct to remove the #as: and what was its
>> > intention? It doesn't break any tests though, so I guess it is fine.
>> > Alternatively we could implement the method in SortedCollection like
>> > this.
> I think the tests are not thorough enough then, though I thought I had
> tests for the class of the returned object (maybe we removed them
> because they were failing?). But it does seem like #sorted:, which
> returns a copy, should be returning an instance of #species (certainly
> this is necessary for classes like Interval, which has a species of
> Array).
Wouldn't that be ^(self as: self species) sortBy: sortBlock?
Paolo
More information about the seaside-dev
mailing list