From: "David A. Black" Date: 2008-01-03T11:42:07+09:00 Subject: Re: singleton-of-singleton is Class in 1.9.0 Hi -- On Wed, 2 Jan 2008, Sylvain Joyeux wrote: > In 1.9.0, the singleton of a singleton is Class, while in 1.8 it was a > singleton itself (see below). Is that an intended behaviour just to > make singletons slightly different than real classes, or is it a bug ? > > [~]% irb1.9 >>> obj = Object.new > => # >>> sing = class << obj; self end > => #> >>> sing_of_sing = class << sing; self end > => Class > > [~]% irb >>> obj = Object.new > => # >>> sing = class << obj; self end > => #> >>> sing_of_sing = class << sing; self end > => #>> I would think it must be a bug. It makes it impossible to add class methods of a singleton class, which would be an odd limitation. (Maybe not the most frequent use case, but even so.) David -- Training for 2008! Ruby on Rails training by David A. Black/Ruby Power and Light, LLC: * Intro to Rails, New York, NY, February 4-7 2008 * Advancing With Rails, New York, NY, February 11-14 2008 Hosted by Exceed Education. See http://www.rubypal.com for details!