From: Albert Wagner Date: 2002-07-05T01:11:22+09:00 Subject: Re: (0..3) == (0...4) returning false? On Thursday 04 July 2002 03:27 am, T.M. Sommers wrote: > Albert Wagner wrote: > > On Tuesday 02 July 2002 02:57 am, Massimiliano Mirra wrote: > > > Is there a reason for two ranges holding the same extension but > > > initialized respectively with `..' and `...' to be considered > > > different in a comparison? > > > > > > Massimiliano > > > > I think you are right in your surprise. The confusion comes when one > > group sees a range of integers as a set of integers and another group > > sees a range as a continuum of floats. The "correct" answer depends of > > first determining the definition of a range: (1) a collection or (2) a > > single continuum. > > If I understand the pickaxe book correctly, Ranges must be made of > objects with a succ method, and Range#=== returns true if the object is > an element of the range. To me, this implies that a Range can't be made > up of Floats, and that (0...4) === 3.2 should return false. A continuum > would be an entirely different kind of object. Or am I being overly > pedantic? I think you are absolutely right. The succ test is appropriate.