Ammar Ali wrote in post #960710:
>> No variable ever *is* an object in Ruby. Variables *reference* objects!
>
> Now that's a different, or at least clearer, statement. And it fits
> with what I know.

Yes. It's important when you compare "pass by value" or "pass by eference" in other languages. In ruby, everything is "pass by value", nd each value is a reference to an object - even integers.

IMO this is a *huge* logical simplification over languages like perl scalar? array? array ref? list? hash? hash ref? filehandle? typeglob? ubroutine? Deal with them all differently)

In ruby, a local variable is not an object, and as such you can never btain a "reference" to it.

def foo(x)
  x << " world"
end

a = "hello"
foo(a)

a is passed by value, so the method call foo(a) can never affect the alue of a - it must remain pointing to the same object after the call. owever, if the object is mutable, it can cause it to change state using the << method in the example above)