+1

Redefining Float#inspect to produce a string that can exactly represents the
object makes perfect sense to me.  Consider that this is the way
String#inspect, Symbol#inspect and most others work.

If that change were made,
to revert Float#inspect back to the current behavior, all one would need is:

class Float
  alias_method :to_s, :inspect
end


Jacob Fugal-2 wrote:
> 
> 
>>
>> Keeping #to_s behavior unchanged would break very little existing
>> code, and having #inspect return something that allows reconstructing
>> the same object is generally a very nice thing, IMO.
> 
> I feel a lot more comfortable "fixing" Float#inspect to be more
> verbose than I do Float#to_s. I'm against changing Float#to_s in the
> ways proposed, but can accept changing Float#inspect.
> 
> ...
> 
> To accomodate both worlds, let's be sure to include a means to revert
> to the old Float#inspect (without redefining it ourselves) that could
> be included in .irbrc files. The default can be the verbose
> Float#inspect, but easily overridden for users who like the old
> behavior.
> 
> Jacob Fugal
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/-ruby-core%3A22325--suggestions-for-float-tp22144150p22384695.html
Sent from the ruby-core mailing list archive at Nabble.com.