[Pharo-dev] Problem in #sorted: for some collections

Damien Cassou damien.cassou at gmail.com
Mon Aug 19 11:33:32 EDT 2013

col := OrderedCollection new.
col add: 1.
col add: 3.
col add: 2.
col sorted.

you will see that col is now sorted. This is wrong. We expect #sorted
to return a sorted collection without changing the receiver.

This code

col := Array with: 1 with: 3 with: 2.
col sorted.

works as expected.

Damien Cassou

"Success is the ability to go from one failure to another without
losing enthusiasm."
Winston Churchill

More information about the Pharo-dev mailing list