From: Robert Klemme Date: 2009-12-22T23:49:24+09:00 Subject: Re: integers and floats 2009/12/22 Florian Gilcher : > > On Dec 22, 2009, at 11:03 AM, Paul Smith wrote: > >> On Tue, Dec 22, 2009 at 2:16 PM, Rajinder Yadav wrote: > >> I have no idea what, if anything, has the object_ids 0, and 2. > > Pretty easy: false and true. > > irb(main):001:0> true.object_id > => 2 > irb(main):002:0> false.object_id > => 0 You need to know but there is a way that works without oracle turing machine: irb(main):005:0> 10.times {|i| printf "%4d %p\n", i, ObjectSpace._id2ref(i) rescue nil} 0 false 1 0 2 true 3 1 4 nil 5 2 7 3 9 4 => 10 :-) Kind regards robert -- remember.guy do |as, often| as.you_can - without end http://blog.rubybestpractices.com/