From: Run Paint Run Run Date: 2009-06-14T06:34:43+09:00 Subject: [ruby-core:23843] Differences in Rational Between 1.8 and 1.9 I'm writing RubySpec specifications for Rational in 1.9. Enumerated below are the key changes between 1.8 and 1.9 that I've discovered so far. I'd appreciate either confirmation that they are intentional, or a suggestion to file a bug report. 1) 1.8 used the Rational::Unify constant to determine whether Rational(integer) should return a Fixnum or a Rational. 1.9 doesn't support this functionality. 2) 1.8 had a #new! constructor that created a Rational without reducing its arguments; 1.9 doesn't appear to have an alternative. 3) Rational#coerce tried to call #to_f on its argument on 1.8; it doesn't on 1.9. 4) 1.8 had a Rational.allocate method that returned Rational(nil, nil). Given that this invocation is illegal under 1.9, and rational.c contains "rb_undef_method(CLASS_OF(rb_cRational), "allocate");", I assume it has been removed intentionally. 5) Rational.reduce has been removed, presumably because Rational now automatically reduces. However, if #new!, or something similar, is reimplemented, would this be restored? 6) Rational#to_s returns "n/d" and Rational#inspect returns "(n/d)". 7) On 1.8 #inspect returned a string that could be eval'd to give self; it doesn't on 1.9. 8) There is no documentation. Would a patch be accepted, or is somebody working on this? 9) These changes, assuming intentionality, are not documented in doc/NEWS-1.9.1. Would a ticket to rectify this be appropriate? -- Run Paint Run Run