"Hal E. Fulton" wrote:
> ----- Original Message -----
> From: Alexander Schofield <pcs3 / njit.edu>
> To: ruby-talk ML <ruby-talk / ruby-lang.org>
> Sent: Thursday, December 20, 2001 12:27 PM
> Subject: [ruby-talk:29154] special case?
> 
> > Just out of curiosity, why can't I say:
> >
> > irb(main):001:0> class << 1
> > irb(main):002:1> def meth
> > irb(main):003:2> end
> > irb(main):004:1> end
> > TypeError: no virtual class for Fixnum
> >         from (irb):1
> >
> > ?
> >
> > Is this a hole in the pure OO of ruby, or is there an OO explanation?
> 
> It's rather a hole. The current implementation of
> primitive types does not lend itself well to singletons.
> (I think it's just Fixnum, true, false, and nil that can't
> have singletons.)
> 
> I believe this will change in the future, from what I've
> heard Matz say in the past.

If and when this does change, will the behavior of Bignums be changed so
that the second case returns true as well?  Or will Fixnums behavior
become more like Bignum?

irb(main):001:0> 1.equal? 1
true
irb(main):002:0> (2**30).equal? (2**30)
false