From: "David A. Black" Date: 2008-09-11T22:46:48+09:00 Subject: [ruby-core:18556] Re: Class as second-generation singleton class Hi -- I'm just bumping this in the hope that someone can explain its purpose, or perhaps make it go away :-) David On Tue, 2 Sep 2008, David A. Black wrote: > Hi -- > > I'm totally unclear on the rationale for this behavior in 1.9: > > class Object > def singleton_class > class << self; self; end > end > end > > "".singleton_class.singleton_class # => Class > > I don't see how it makes sense for Class to report itself as the > singleton class of any object, including a singleton class. It's not > likely that this double-depth singleton class would be needed, but I > think it should behave predictably: > > class << obj # obj's singleton class > > and not have a special case wired into it. Maybe I'm missing > something? > > > David > > -- > Rails training from David A. Black and Ruby Power and Light: > Intro to Ruby on Rails January 12-15 Fort Lauderdale, FL > Advancing with Rails January 19-22 Fort Lauderdale, FL * > * Co-taught with Patrick Ewing! > See http://www.rubypal.com for details and updates! > -- Rails training from David A. Black and Ruby Power and Light: Intro to Ruby on Rails January 12-15 Fort Lauderdale, FL Advancing with Rails January 19-22 Fort Lauderdale, FL * * Co-taught with Patrick Ewing! See http://www.rubypal.com for details and updates!