[#23231] What do you think about changing the return value of Kernel#require and Kernel#load to the source encoding of the required file? — =?ISO-8859-15?Q?Wolfgang_N=E1dasi-Donner?= <ed.odanow@...>

Dear Ruby developers and users!

8 messages 2009/04/17

[#23318] [Feature #1408] 0.1.to_r not equal to (1/10) — Heesob Park <redmine@...>

Feature #1408: 0.1.to_r not equal to (1/10)

19 messages 2009/04/26

[ruby-core:23191] Re: [Bug #1336] Change in string representation of Floats

From: Eero Saynatkari <ruby-ml@...>
Date: 2009-04-13 07:19:11 UTC
List: ruby-core #23191
Excerpts from Yukihiro Matsumoto's message of Mon Apr 13 05:17:28 +0300 2009:
> Perhaps we need 3 ways for string representation:
> 
>   * mere string representation
>   * human readable representation
>   * regenerating representation (as in [ruby-core:23128])

I think I am in agreement, but I  would like to amend the
description of the three to confirm:

  #to_s:    String representing the object mainly for output
  #inspect: Internal details, ivars etc., mainly for debug
  #dump:    Round-trip/evalable representation

The latter's usefulness is slightly questionable since, as
was pointed out, one may round-trip through e.g. Marshal,
but it could be assumed to be a 'lighter-weight' version
(surely a less intimidating one) of the same.

Since String#dump already exists, perhaps a different name
is in order for the latter. Call it #to_eval or whatever,
but I believe these three offer the necessary granularity
of semantics.

Is this an agreeable proposition?


--
Magic is insufficiently advanced technology.

In This Thread