On 2009-11-04, lith <minilith / gmail.com> wrote:
>> gsub! can work because somewhere inside the object there is a hunk of storage
>> which is separate from the object itself. ixnum has no such storage to
>> refer to.

> I don't think ruby makes the distinction between native types &
> objects la java.

Everything is an object.

Not every object contains separate storage.

When you write "a = 1; b = 1;", a and b do not refer to two separate objects
which happen to have the same numeric value; they refer to a single object
which has an immutable numeric value.  You can't increment that value.

-s
-- 
Copyright 2009, all wrongs reversed.  Peter Seebach / usenet-nospam / seebs.net
http://www.seebs.net/log/ <-- lawsuits, religion, and funny pictures
http://en.wikipedia.org/wiki/Fair_Game_(Scientology) <-- get educated!