David A. Black wrote: >>> I wouldn't say it's a pointer. "Reference" is the universal term, as >>> far as I've heard. >> What language is ruby written in? (Not jRuby or IronRuby.) > > C. It sounds like you're asking the question rhetorically, though. I'm > not sure what you mean. C doesn't have references. Hence, as a metaphor for Ruby, the 'a' in 'a = Dog.new' is a pointer to a Dog. If we then say 'a = Conure.new', that reseats 'a' to point at something else. In C terms, it's a pointer with the indirection already turned on. *a. And... C++ has references; 'Dog & a = some_dog'. These are more than just pointers with their indirection turn on, because 'a' can be optimized away, and cannot reseat. That means attempts to treat 'a' as a pointer (such as by reinterpret_cast-ing its container) can lead to undefined behavior. So Ruby methods, like Java, are pass-by-value, where the value is a copy of a pointer. Hence the pointed-to objects behave as pass-by-reference. -- Phlip