DEV Community

Discussion on: From JavaScript to Ruby: A few of my favourite features

Collapse
 
dgm profile image
dgm

It's not really a memory location. It's just an object id. Yes it's useful to see if two objects are really the same exact object, which is kind of similar to a memory location, but for example, there is a object id of 1.

ObjectSpace._id2ref(1).object_id
=> 1

That's hardly a memory location. :)

ObjectSpace can do some interesting things, none of which should probably be used in normal programming.