ふなばさん
遠藤です。

Rational#rationalize を始め、多くの #rationalize メソッドが削除
されたようですが、何か理由があってのことでしょうか。


すでに feature freeze 済みであるため、今後互換性を維持するのに
重大な問題があるなど、本当にやむを得ない理由があるのでない限りは
削除してはいけません。
experimental であっても、trunk にコミットした状態で feature freeze
してしまった以上、手遅れであると考えます。

考えがあってのことでしたら、まずは理由をお聞かせください。


ちなみに、rubyspec が大量にエラーを出すようになっています。

1)
Complex#rationalize raises RangeError if self has non-zero imaginary part FAILED
Expected RangeError
but got NoMethodError (undefined method `rationalize' for (1+5i):Complex)
/home/mame/work/ruby/spec/rubyspec/core/complex/rationalize_spec.rb:6:in
`block (3 levels) in <top (required)>'
/home/mame/work/ruby/spec/rubyspec/core/complex/rationalize_spec.rb:3:in
`block in <top (required)>'
/home/mame/work/ruby/spec/rubyspec/core/complex/rationalize_spec.rb:1:in
`<top (required)>'

2)
Complex#rationalize returns a Rational if self has zero imaginary part ERROR
NoMethodError: undefined method `rationalize' for (1+0i):Complex
/home/mame/work/ruby/spec/rubyspec/core/complex/rationalize_spec.rb:10:in
`block (3 levels) in <top (required)>'
/home/mame/work/ruby/spec/rubyspec/core/complex/rationalize_spec.rb:3:in
`block in <top (required)>'
/home/mame/work/ruby/spec/rubyspec/core/complex/rationalize_spec.rb:1:in
`<top (required)>'

...

4)
Float#rationalize returns self as a simplified Rational with no argument ERROR
NoMethodError: undefined method `rationalize' for 3382729202.92822:Float
/home/mame/work/ruby/spec/rubyspec/core/float/rationalize_spec.rb:6:in
`block (3 levels) in <top (required)>'
/home/mame/work/ruby/spec/rubyspec/core/float/rationalize_spec.rb:4:in
`block in <top (required)>'
/home/mame/work/ruby/spec/rubyspec/core/float/rationalize_spec.rb:3:in
`<top (required)>'

5)
Float#rationalize simplifies self to the degree specified by a
Rational argument ERROR
NoMethodError: undefined method `rationalize' for 0.3:Float
/home/mame/work/ruby/spec/rubyspec/core/float/rationalize_spec.rb:13:in
`block (3 levels) in <top (required)>'
/home/mame/work/ruby/spec/rubyspec/core/float/rationalize_spec.rb:4:in
`block in <top (required)>'
/home/mame/work/ruby/spec/rubyspec/core/float/rationalize_spec.rb:3:in
`<top (required)>'

6)
Float#rationalize simplifies self to the degree specified by a Float
argument ERROR
NoMethodError: undefined method `rationalize' for 0.3:Float
/home/mame/work/ruby/spec/rubyspec/core/float/rationalize_spec.rb:24:in
`block (3 levels) in <top (required)>'
/home/mame/work/ruby/spec/rubyspec/core/float/rationalize_spec.rb:4:in
`block in <top (required)>'
/home/mame/work/ruby/spec/rubyspec/core/float/rationalize_spec.rb:3:in
`<top (required)>'

7)
Float#rationalize raises a FloatDomainError for Infinity FAILED
Expected FloatDomainError
but got NoMethodError (undefined method `rationalize' for Infinity:Float)
/home/mame/work/ruby/spec/rubyspec/core/float/rationalize_spec.rb:33:in
`block (3 levels) in <top (required)>'
/home/mame/work/ruby/spec/rubyspec/core/float/rationalize_spec.rb:4:in
`block in <top (required)>'
/home/mame/work/ruby/spec/rubyspec/core/float/rationalize_spec.rb:3:in
`<top (required)>'

8)
Float#rationalize raises a FloatDomainError for NaN FAILED
Expected FloatDomainError
but got NoMethodError (undefined method `rationalize' for NaN:Float)
/home/mame/work/ruby/spec/rubyspec/core/float/rationalize_spec.rb:37:in
`block (3 levels) in <top (required)>'
/home/mame/work/ruby/spec/rubyspec/core/float/rationalize_spec.rb:4:in
`block in <top (required)>'
/home/mame/work/ruby/spec/rubyspec/core/float/rationalize_spec.rb:3:in
`<top (required)>'

...

13)
NilClass#rationalize returns 0/1 ERROR
NoMethodError: undefined method `rationalize' for nil:NilClass
/home/mame/work/ruby/spec/rubyspec/core/nil/rationalize_spec.rb:6:in
`block (3 levels) in <top (required)>'
/home/mame/work/ruby/spec/rubyspec/core/nil/rationalize_spec.rb:4:in
`block in <top (required)>'
/home/mame/work/ruby/spec/rubyspec/core/nil/rationalize_spec.rb:3:in
`<top (required)>'

14)
NilClass#rationalize ignores arguments ERROR
NoMethodError: undefined method `rationalize' for nil:NilClass
/home/mame/work/ruby/spec/rubyspec/core/nil/rationalize_spec.rb:10:in
`block (3 levels) in <top (required)>'
/home/mame/work/ruby/spec/rubyspec/core/nil/rationalize_spec.rb:4:in
`block in <top (required)>'
/home/mame/work/ruby/spec/rubyspec/core/nil/rationalize_spec.rb:3:in
`<top (required)>'

15)
Numeric#rationalize returns a Rational object ERROR
NoMethodError: undefined method `rationalize' for 0:Fixnum
/home/mame/work/ruby/spec/rubyspec/core/numeric/rationalize_spec.rb:16:in
`block (4 levels) in <top (required)>'
/home/mame/work/ruby/spec/rubyspec/core/numeric/rationalize_spec.rb:15:in `each'
/home/mame/work/ruby/spec/rubyspec/core/numeric/rationalize_spec.rb:15:in
`block (3 levels) in <top (required)>'
/home/mame/work/ruby/spec/rubyspec/core/numeric/rationalize_spec.rb:4:in
`block in <top (required)>'
/home/mame/work/ruby/spec/rubyspec/core/numeric/rationalize_spec.rb:3:in
`<top (required)>'

16)
Numeric#rationalize uses self as the numerator ERROR
NoMethodError: undefined method `rationalize' for 0:Fixnum
/home/mame/work/ruby/spec/rubyspec/core/numeric/rationalize_spec.rb:22:in
`block (4 levels) in <top (required)>'
/home/mame/work/ruby/spec/rubyspec/core/numeric/rationalize_spec.rb:21:in `each'
/home/mame/work/ruby/spec/rubyspec/core/numeric/rationalize_spec.rb:21:in
`block (3 levels) in <top (required)>'
/home/mame/work/ruby/spec/rubyspec/core/numeric/rationalize_spec.rb:4:in
`block in <top (required)>'
/home/mame/work/ruby/spec/rubyspec/core/numeric/rationalize_spec.rb:3:in
`<top (required)>'

17)
Numeric#rationalize uses 1 as the denominator ERROR
NoMethodError: undefined method `rationalize' for 0:Fixnum
/home/mame/work/ruby/spec/rubyspec/core/numeric/rationalize_spec.rb:28:in
`block (4 levels) in <top (required)>'
/home/mame/work/ruby/spec/rubyspec/core/numeric/rationalize_spec.rb:27:in `each'
/home/mame/work/ruby/spec/rubyspec/core/numeric/rationalize_spec.rb:27:in
`block (3 levels) in <top (required)>'
/home/mame/work/ruby/spec/rubyspec/core/numeric/rationalize_spec.rb:4:in
`block in <top (required)>'
/home/mame/work/ruby/spec/rubyspec/core/numeric/rationalize_spec.rb:3:in
`<top (required)>'

...

19)
Rational#rationalize returns self with no argument ERROR
NoMethodError: undefined method `rationalize' for (4/1):Rational
/home/mame/work/ruby/spec/rubyspec/core/rational/rationalize_spec.rb:6:in
`block (3 levels) in <top (required)>'
/home/mame/work/ruby/spec/rubyspec/core/rational/rationalize_spec.rb:4:in
`block in <top (required)>'
/home/mame/work/ruby/spec/rubyspec/core/rational/rationalize_spec.rb:1:in
`<top (required)>'

20)
Rational#rationalize simplifies self to the degree specified by a
Rational argument ERROR
NoMethodError: undefined method `rationalize' for
(5404319552844595/18014398509481984):Rational
/home/mame/work/ruby/spec/rubyspec/core/rational/rationalize_spec.rb:14:in
`block (3 levels) in <top (required)>'
/home/mame/work/ruby/spec/rubyspec/core/rational/rationalize_spec.rb:4:in
`block in <top (required)>'
/home/mame/work/ruby/spec/rubyspec/core/rational/rationalize_spec.rb:1:in
`<top (required)>'

21)
Rational#rationalize simplifies self to the degree specified by a
Float argument ERROR
NoMethodError: undefined method `rationalize' for
(5404319552844595/18014398509481984):Rational
/home/mame/work/ruby/spec/rubyspec/core/rational/rationalize_spec.rb:25:in
`block (3 levels) in <top (required)>'
/home/mame/work/ruby/spec/rubyspec/core/rational/rationalize_spec.rb:4:in
`block in <top (required)>'
/home/mame/work/ruby/spec/rubyspec/core/rational/rationalize_spec.rb:1:in
`<top (required)>'

-- 
Yusuke Endoh <mame / tsg.ne.jp>