Hi,

I've made the following observations about Ruby's apparent
implementation:

1. Integer's in the range -2**30 to 2**30-1 are Fixnum's. Integers
outside that range are Bignum's
2. For Fixnum "i",  i's object_id is twice i's value plus 1.  Said
another way, i's object_id is i''s binary value left-shifted with 1 as
padding.
3. Object_id's of Bignum's close to the boundaries of Fixnum's bear no
apparent relationship to the Fixnum object_id's.

These observations suggest to me that an assignment statement like
"a=1" requires the interpreter to do no more than:
1.  Search for the identifier "a" in the current scope.
2.  If found, use it; if not, enter it in the current scope and then
use it.
3. "Use it" means take the binary representation of the assigned
value,  left shift it with "1" padding, and make that current
object_id of the identifier "a".
4. There is no need to locate free space in an memory pool where
object values for Bignums, Strings and other object are stored.  For
Fixnums, the object_id IS the value, just a little shifted.

Is my speculation about this aspect of Ruby's implementation correct,
or am I all wet?

Thanks in advance for any comments you may wish to offer,
Richard