From: "Hal E. Fulton" Date: 2001-12-21T06:45:59+09:00 Subject: [ruby-talk:29172] Re: special case? ----- Original Message ----- From: Alexander Schofield To: ruby-talk ML 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. Hal