From: ara.t.howard@... Date: 2007-02-21T13:37:29+09:00 Subject: Re: Range#overlap? On Wed, 21 Feb 2007, Gregory Brown wrote: > On 2/20/07, Suraj Kurapati wrote: >> unknown wrote: >> > I think that overlap? and within? are two different things, which I'm >> > not sure you think from your email. Overlap? suggests, to me, that a >> > subset of the things one range includes is the same as a subset of >> > things that the other range includes. Within? suggests that all of one >> > range is contained in a subset of the other range. >> >> Agreed. These terms evoke the following synonyms in my mind: >> >> overlap? means intersect? >> >> within? means subset? > > These are much better names, I think. Of course, it'll only be so if > you are mathematically inclined. > indeed. overlaps would normally be defined as def overlap? other first < other.last and other.first < last end in math is always means 'proper subset'. in otherwords (0..42).overlap? (1..10) #=> true (1..10).overlap? (0..42) #=> true ignoring issues of inclusive and exclusive end which, i might add, all the presented implimentations do as well. regards. -a -- we can deny everything, except that we have the possibility of being better. simply reflect on that. - the dalai lama