On Mon, 25 Feb 2002 18:38:17 GMT, Dave Thomas
<Dave / PragmaticProgrammer.com> wrote:

>Ron Jeffries <ronjeffries / REMOVEacm.org> writes:
>
>> I don't understand the notation above with class << etc. What's up with
>> that? How is it different from
>> 
>> class Set
>>   protected :new
>> end
>
>'new' isn't an instance method of class Set, so the line above
>wouldn't work. Instead, new is defined in Set's metaclass. You can
>pop into the metaclass using the singleton class thingy.
>
>   class <<x
>     ..
>   end
>
>means start defining stuff in the class specific to object 'x'. Inside
>a normal class definition, 'self' is the class itself, so class <<self
>gets us into the meta class. Hence
>
>  class <<self
>    protected :new
>  end

Check. Weird but I get it. Thanks!

Ronald E Jeffries
http://www.XProgramming.com
http://www.objectmentor.com
I'm giving the best advice I have. You get to decide whether it's true for you.