From: Chad Perrin Date: 2006-08-03T02:07:46+09:00 Subject: Re: I thought this was the one that worked? On Thu, Aug 03, 2006 at 01:11:35AM +0900, Jacob Fugal wrote: > > self is not just a memory address (well, not any more than any other > object reference). You're seeing the memory address because that's the > default #inspect output for an object, but it's not really relevant > here. self is an object reference just like any other variable would > be. Let's replace the contents of the evals with a method call > instead: > > # using the same definition of Foo as referenced earlier > foo1, foo2 = Foo.new, Foo.new > foo1.object_id # => 1742734 > foo2.object_id # => 1742684 > > blk1, blk2 = foo1.bar, foo2.bar > eval "object_id", blk1 # => 1742734 > eval "object_id", blk2 # => 1742684 > > I also captured the Foo objects themselves so we can see that the > object_id method call is being sent to the foo object rather than the > block itself. Are we sure, though, that we're not just looking at a number (associated with that instance) that's stored in a hash table external to the object? -- CCD CopyWrite Chad Perrin [ http://ccd.apotheon.org ] unix virus: If you're using a unixlike OS, please forward this to 20 others and erase your system partition.