From: Ondrej Bilka Date: 2006-08-13T18:13:18+09:00 Subject: Re: Again Range=== bug On Sun, Aug 13, 2006 at 10:25:03AM +0200, nobu@ruby-lang.org wrote: > Hi, > > At Sun, 13 Aug 2006 15:59:24 +0900, > Ondrej Bilka wrote in [ruby-core:08609]: > > Problem of discrete membership at Range#=== is that it returns unexpected > > result when treating float-like Classes. Class Time is represented as > > float so > > (Time.new...Time.new+5)===Time.new returns false. > > Really? > > $ ruby -ve 't = Time.new; p((t...t+5)===t+1)' > ruby 1.9.0 (2006-08-12) [i686-linux] > true > > And Time isn't float. > > > I choose Comparable#between? but I rather change its > > arguments to low.between?(value, high,excl) because now value > > doesnt know what range represents and can only guess that > > they are same type.(I dont know how frequently its used. ) > > Double dispatch may be considerable, but that change of > "between?" feels doubtful to me. > > -- > Nobu Nakada > Can someone simply cut my text and paste it??? If you are lazy try t=Time.new (t...t+5.5)===t+2.3 which return false too