logo       

Sortable?: msg#00082

lang.smalltalk.squeak.beginners

Subject: Sortable?

Hey,

I want to have a collection that's sortable but not always sorted. I've been using (essentially):

mySortedCollection := myOrderedCollection asSortedCollection.
myOrderedCollection := mySortedCollection asOrderedCollection.

Or just:

s := (s asSortedCollection) asOrderedCollection.

OK? (It seems fine to me, but part of my mind still sticks thinks "Gee, that's a lot of overhead.") I really just want to write:

s sort.

I see the tools are there for SortedCollection but they're not meant to be used, I think.

===Blake===


<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

News | FAQ | advertise