[#29911] [Bug #3231] Digest Does Not Build — Charlie Savage <redmine@...>

Bug #3231: Digest Does Not Build

19 messages 2010/05/01

[#29920] [Feature #3232] Loops (while/until) should return last statement value if any, like if/unless — Benoit Daloze <redmine@...>

Feature #3232: Loops (while/until) should return last statement value if any, like if/unless

9 messages 2010/05/01

[#29997] years in Time.utc — Xavier Noria <fxn@...>

Does anyone have a precise statement about the years supported by

13 messages 2010/05/04

[#30010] [Bug #3248] extension 'tk' is finding tclConfig.sh and tkConfig.sh incorrectly — Luis Lavena <redmine@...>

Bug #3248: extension 'tk' is finding tclConfig.sh and tkConfig.sh incorrectly

9 messages 2010/05/05

[#30226] [Bug #3288] Segmentation fault - activesupport-3.0.0.beta3/lib/active_support/callbacks.rb:88 — Szymon Jeż <redmine@...>

Bug #3288: Segmentation fault - activesupport-3.0.0.beta3/lib/active_support/callbacks.rb:88

10 messages 2010/05/13

[#30358] tk doesn't startup well in doze — Roger Pack <rogerdpack2@...>

Currently with 1.9.x and tk 8.5,the following occurs

12 messages 2010/05/22

[ruby-core:30488] Re: Conventions for implementing #inspect

From: Caleb Clausen <vikkous@...>
Date: 2010-05-28 13:51:05 UTC
List: ruby-core #30488
On 5/28/10, Nikolai Weibull <now@bitwi.se> wrote:
> What exactly is the convention for writing an #inspect method?  The
> core isn稚 that consistent.  Some definitions return a string in the
> actual read syntax, for example, String.  Others, that lack a read
> syntax, return #<class some-relevant-data> (File::Stat),
> #<class:some-relevant-data> (Dir), or #<class: some-relevant-data>
> (Enumerator).  Finally, some return the same result as #to_s-, for
> example, Time.
>
> Read syntax makes sense.
>
> The #<class convention makes sense, but why is it applied inconsistently?
>
> What is the reasoning behind returning whatever #to_s returns?  Is it
> simply obvious enough what the data the string represents that
> returning something like #<Time: 2007-10-05 16:09:51 UTC> would be
> silly?

inspect is supposed to return a human-readable string representing the
object being inspected. It was never intended (unfortunately) to
return strings which make sense to ruby as well (tho sometimes it
does).

I wrote a library which allows you to turn (almost) any object into an
equivalent inspect-like string. It's much more thorough than inspect;
for instance, it handles user-defined Objects and recursive data
structures correctly.

In This Thread

Prev Next