On Thu, Nov 5, 2009 at 12:55 AM, RichardOnRails
<RichardDummyMailbox58407 / uscomputergurus.com> wrote:
>
> BTW,  ¨Â§í îïáäöïãáôéîç ø«æïÒõâù ¨Â§í êõóô ôòùéîç ôï õîäåòóôáîä
> whether Ruby would literally change 1 to 2 as opposed to change a
> variable that contains 1 to subsequently contain 2.

Variables don't contain values, they refer to objects. That's the
fundamental difference. So if you say, for instance

a = "hello world"
a.upcase!
a #=> "HELLO WORLD"

the message "upcase!" is sent to the *object* "hello world", not the
variable a. To see this:

a = "hello world"
b = a
a.upcase!
a #=> "HELLO WORLD"
b #=> "HELLO WORLD"

Fixnums are immutable objects; you can't have any method that changes
their value. Hence no ++

martin