> > >>>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

$ ruby1.9 -ve 't = Time.new; p((t...t+5)===t+1)'
ruby 1.9.0 (2006-06-08) [i486-linux]
false

Note the different date (this is the debian unstable package).

> > >Can someone simply cut my text and paste it???
> > 
> > irb(main):010:0> (Time.new...Time.new+5)===Time.new
> > => true
> > irb(main):011:0> RUBY_VERSION
> > => "1.8.4"
> > 
> > >If you are lazy try
> > >t=Time.new
> > >(t...t+5.5)===t+2.3
> > >which return false too
> > 
> > irb(main):012:0> t = Time.new
> > => Sun Aug 13 06:34:02 EDT 2006
> > irb(main):013:0> (t...t+5.5)===t+2.3
> > => true
>
> My bad assumption that 1.9.0 is at sync with 1.8.4
> puts RUBY_VERSION
> puts (Time.new...Time.new+5)===Time.new
> 1.9.0
> false

There seems to have been issues with it, but I'd say 'more recent' ruby
1.9 has the expected behavior.

Hth,
Kero.

+--- Kero ---------------------------------- kero@chello@nl ---+
|  The last good thing written in C++ was the Pachelbel Canon  |
|  Jerry Olson                                                 |
+--- M38c ------------ http://members.chello.nl/k.vangelder ---+