From: Martin DeMello Date: 2003-08-09T20:52:01+09:00 Subject: Re: Ruby and OOP-design (question of an old "procedural person" ;) Gavin Sinclair wrote: > Actually, I fancy > > def <=>(other) > [self.freq, self.time] <=> [other.freq, other.time] > end > > I don't know if it works, but I fancy it. Given what I know about > Ruby, I'd be surprised if it *didn't* work. So it does! Nice one. One could even imagine something analogous to class Broadcast cmp_by :freq, :time which generates the <=> method, though we'd need to think up some nice syntax for reversing fields. martin