From: Pete Date: 2005-12-30T19:13:39+09:00 Subject: Re: Fixnums can have instance variables? Cool. class Object def foo "foo" end class < "foo" Bignum.bar -> "bar On Fri, 30 Dec 2005 09:57:09 +0100, Chris Pine wrote: > On 12/30/05, gwtmp01@mac.com wrote: >> Am I the only person with their jaw on the ground? > > When I discovered this, what surprised me was not so much that you > could do this, but that can do this _even_though_ you can't give them > singleton methods (or access their singleton classes). > > I just assumed the reason was because the singleton classes are stored > in some structure that immediate values don't have, but that instance > variables are stored separately in some other way. (I never looked at > the interpreter source to verify this, though.) > > So the question in my mind: Is there a reason we couldn't do that > with ints, too? > > Chris >