From: Martin DeMello Date: 2003-08-09T19:31:47+09:00 Subject: Re: Ruby and OOP-design (question of an old "procedural person" ;) Florian Frank wrote: > > def <=>(other) > (self.freq <=> other.freq).nonzero? || other.time <=> self.time > end Shouldn't that be def <=>(other) a = (self.freq <=> other.freq) a.nonzero? ? a : (other.time <=> self.time) end since calling nonzero? collapses [-1,1] to 'true'. martin