From: Robert Klemme Date: 2007-06-07T00:35:10+09:00 Subject: Re: # <--- why is the displayed number == object_id*2 On 06.06.2007 17:10, Meinrad Recheis wrote: > irb(main):001:0> VERSION > => "1.8.5" > irb(main):002:0> o=Object.new > => # > irb(main):003:0> ObjectSpace._id2ref 0x2c1c8f0 > RangeError: 0x2c1c8f0 is not id value > from (irb):3:in `_id2ref' > from (irb):3 > irb(main):004:0> ObjectSpace._id2ref 0x2c1c8f0/2 > => # > irb(main):005:0> > > I think that is pretty confusing. I am sure there is a good reason for > this. But, don't you think it'd be better to display the real > object_id instead of the doubled value? The output of #inspect is not meant to give you any means to get at the original object although it may seem so at times. Having said that, #object_id and #inspect are completely unrelated and it's just an implementation artifact that some classes actually return something that resembles the object id. As far as I remember this list you are the first one that mentions this. So it's probably not that big an issue (at least not as confusing as "singleton class" :-)) Kind regards robert