Robert Klemme wrote in post #1090092:
>  - All variables hold _references_ to objects.*

And this is a huge breath of fresh air compared to, say, Perl, where 
arrays and arrayrefs are two different types of value, similarly hashes 
and hashrefs, and a whole bunch of other special cases.

In ruby, *all* values are references to objects. Even integers.

>> a = -3
=> -3
>> a.to_s
=> "-3"
>> a.abs
=> 3

So consistently:

- everything is pass-by-value
- every value is a reference to an object

But as you have discovered, many objects are mutable, including strings.

-- 
Posted via http://www.ruby-forum.com/.