From: Hal Fulton Date: 2006-08-09T13:56:39+09:00 Subject: Re: why doesn't Array include Comparable ara.t.howard@noaa.gov wrote: > > why __wouldn't__ one want this? > > > > harp:~ > cat a.rb > a = 0,1,2 > b = 2,3,4 > > p a < b rescue puts "can't do that!" > > class Array; include Comparable; end > > p a < b > > > harp:~ > ruby a.rb > can't do that! > true > > ?? Offhand I would guess it's because arrays can hold arbitrary objects. If one array held four different classes of objects, and another held yet another four classes of objects, that's potentially sixteen spaceship operators that would need to be defined for this to make sense. And most of those would not make sense anyway. Hal