seebs
6/6/2007 3:22:00 PM
In message <43d756720706060810s53f67ec8yc9c0f3734d1f233f@mail.gmail.com>, "Meinrad Recheis" wri
tes:
>irb(main):001:0> VERSION
>=> "1.8.5"
>irb(main):002:0> o=Object.new
>=> #<Object:0x2c1c8f0>
>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
>=> #<Object:0x2c1c8f0>
>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?
Maybe it would. That said, Object.object_id works as expected, so this
only affects irb's display.
(The reason, presumably, is that the ID is left-shifted by one, because
objects with a 1 in the low-order bit are fixnums.)
-s