From: Rick DeNatale Date: 2007-09-26T02:51:28+09:00 Subject: Re: object_id 1, 2, 3 On 9/24/07, Tim Hunter wrote: > SpringFlowers AutumnMoon wrote: > > Fixnum object_id > > 0 1 > > 1 3 > > 2 5 > > > > -1 -1 > > -2 -3 > > > > > > so the question is... which objects have the object_id 2, 4, 6, and -2, > > -4, etc? > > > > ex$ irb > irb(main):001:0> x = true > => true > irb(main):002:0> x.object_id > => 2 > irb(main):003:0> x = false > => false > irb(main):004:0> x.object_id > => 0 > irb(main):005:0> x = nil > => nil > irb(main):006:0> x.object_id > => 4 > > In other words, very small even values of object_id are reserved for > special values. One should keep in mind that these are interesting implementation artifacts. I don't believe that there's any guarantee that such ids would be the same in an arbitrary ruby implementation or even between versions of the same implementation. -- Rick DeNatale My blog on Ruby http://talklikeaduck.denhaven2.com/