From: Gavin Sinclair Date: 2002-12-02T12:31:16+09:00 Subject: Re: class << self (was Re: [FAQ] What do some of Ruby's symbols mean?) ----- Original Message ----- From: "Bill Kelly" > > > Therefore, ['self'] is only meaningful inside instance methods. > > Hang on.... let the beauty of Ruby flow through you... [snip] > > The beauty here, folding in meta-classes into the mix - and, as I > understand it - is: Class, and the definitions thereof, in Ruby, are > less of a special case than languages such as C++ or Java. 'self' *is* > relevant inside a class definition in Ruby. Think about the possible > implications of the interpreter actually executing statements inside > a class definition when they occur in the source... I'm well aware of that, and have seen it used to great effect: the auto-generation of a whole lot of methods. Heck, even attr_* does this, and that's what I love about Ruby. I very much like the meta-class stuff. It's just that - like it or not - "class << self" is probably a lot more confusing for new people than anything else about Ruby. > . . . Anyway, I'd recommened the section in chapter 19 of Pickaxe, > entitled, "What's the Meta?" -- I just re-read it myself and I'd > forgotten a bit of it............ Will do. Thanks for the tip. Cheers, Gavin