From: dblack@... Date: 2007-02-21T07:59:22+09:00 Subject: Re: [Facets] Range#overlap? Hi -- On Wed, 21 Feb 2007, Daniel Schierbeck wrote: > On Tue, 2007-02-20 at 22:47 +0900, Daniel Finnie wrote: >> That seems to be what facet/range/within does now. > > It's implementation is rather odd, though. > > Here's what I'd like to have instead: > > class Range > def span? other > include? other.first and > other.last <= (other.exclude_end? ? last.succ : last) > end > end Ranges don't always have lasts that have #succ, though. Floats don't, and arbitrary Comparables don't. David -- Q. What is THE Ruby book for Rails developers? A. RUBY FOR RAILS by David A. Black (http://www.manning.com/black) (See what readers are saying! http://www.rubypal.com/r4rrevs.pdf) Q. Where can I get Ruby/Rails on-site training, consulting, coaching? A. Ruby Power and Light, LLC (http://www.rubypal.com)