[squeak-dev] asSortedCollection always copies?

Nicolas Cellier nicolas.cellier.aka.nice at gmail.com
Fri May 6 21:08:55 UTC 2011


However, you will have a difference depending on whether you copy or not:

((1 to: 3) asSortedCollection: [:a :b | a >= b]) asSortedCollection.

Nicolas

2011/5/6 Ralph Boland <rpboland at gmail.com>:
> I am using Squeak 10.2 and haven't checked 4.2 so apologies if this doesn't
> apply to 4.2.  I checked 4.1 though and the problem is in 4.1 also.
>
> Method asSet returns self for sets and method asArray returns self for arrays
> but asSortedCollection returns a copy of the sortedCollection for
> SortedCollections.
>
> This inconsistency constitutes a bug to my mind.
> Unless someone disagrees I will generate a bug report.
> Pointing out that the this is fixed in 4.2 constitutes disagreement.
> (If you fix the bug for 4.3 and then post that it is fixed saves me
> generating the bug report; of course you shouldn't do this).
>
> Regards,
>
> Ralph Boland
>
>



More information about the Squeak-dev mailing list