From: SpringFlowers AutumnMoon Date: 2007-10-01T15:03:18+09:00 Subject: Re: a = Dog.new # a is not a pointer and not a reference? Charles Oliver Nutter wrote: > Ruby variables hold the value of an object reference. If you re-assign > them, you are setting them to a different object reference. If you > retrieve them, you're getting an object reference which you can then > pass by value or use to invoke methods. yes, that's what i mean by thinking of a reference to an object as a pointer. let's say if we implement Ruby, can't we actually set it as a pointer to the Dog object, and then whenever we use d.bark(), it will go to where it points to and start looking for a table of method names. and if not found, go to the parents, again using a pointer to the parent class. i won't increment the pointer or do pointer arithmetic, and i won't care what the pointer's value is (the address) and won't tell the programmer, but underneath, it is still a pointer. so d = Dog.new("lulu") # d points to some new memory chunk b = d # b points to the same place d = Dog.new("woofy") # d now points to a new memory chunk # and b points to the old chunk -- Posted via http://www.ruby-forum.com/.