[Newbies] How to sort a SortedCollection like you can sort a table in Excel?

Jerome Peace peace_the_dreamer at yahoo.com
Wed Apr 14 00:09:12 UTC 2010


HI Keith,

I had thought you were pointing to something already implemented in collection. If it were it is an nice elegant language form.

I don't have an opinion yet about your generalized implementation. In what context do you use it?

In any event your form would not be useful in all contexts. The one Andreas and I use works better when you want to cut off a comparison before evaluating the secondary or tertiary messages. 

In the context of the stated problem it would probably work fine.

Squeak has a deficiency. It can't express properly the concept of plurals.
Ideally I should have message selectors that could work with one or more of a certain type of object. With sqeuak you can't quite get thar from heyah.


Anyway you showed an interesting alternative.

Cheers --Jer  





--- On Tue, 4/13/10, keith <keith_hodges at yahoo.co.uk> wrote:

> From: keith <keith_hodges at yahoo.co.uk>
> Subject: Re: [Newbies] How to sort a SortedCollection like you can sort a table in Excel?
> To: "A friendly place to get answers to even the most basic questions about Squeak." <beginners at lists.squeakfoundation.org>
> Date: Tuesday, April 13, 2010, 9:11 AM
> 
> On 13 Apr 2010, at 01:03, Jerome Peace wrote:
> 
> > Hi Bert, Hi DeBruicker
> > a slight tweak to Bert's method
> > 
> > a height = b height
> > ifFalse: [ a height < b height ]
> >  ifTrue: [ a width = b width
> >    ifFalse: [ a width < b width ]
> >    ifTrue: [ a depth <= b depth ] ] .
> > 
> > Basically if primary sorts values are unequal sort by
> primary values else sort by secondry values etc. This
> basicly recusive procedure will work for any number of sort
> levels.
> > 
> > Yours in curiosity and service, --Jerome Peace
> > 
> 
> 
> Hi Jerome,
> 
> If you look at my implementation you will probably hate it!
> For practical purposes, in my <= implementation for
> SequencableCollection I also handles nil <= anything
> else, and false <= true.
> 
> cheers
> 
> Keith
> _______________________________________________
> Beginners mailing list
> Beginners at lists.squeakfoundation.org
> http://lists.squeakfoundation.org/mailman/listinfo/beginners
> 


      


More information about the Beginners mailing list