----- Original Message -----
From: "Gavin Sinclair" <gsinclair / soyabean.com.au>
To: "ruby-talk ML" <ruby-talk / ruby-lang.org>
Sent: Sunday, December 01, 2002 8:58 AM
Subject: class << self (was Re: [FAQ] What do some of Ruby's symbols mean?)



> But I don't see why I should juggle Ruby meta-class models in my head just
to
> define class methods.
>
> One advantage of the apparently beautiful "class << self" is that you can
> define several class methods at once without explicitly typing the class
name,
> but I don't see what's gained here.  To me it's obfuscated, and even when
> understood - or merely acknowledged - I think the notation is unintuitive.
>
> Hopefully I'm missing something and am about to have my fourth Ruby
epiphany :)

Perhaps it has something to do with modules. You
can define a class method without knowing the
name of the class. (Hmm. True? I did some research
once but it didn't stick to my Teflon brain.)

But then, I find that "def self.meth" seems to
work fine...

In any case, didn't Matz once say that the
"class << self" notation was to be discouraged
in the future? Or am I mistaken?

Hal