Hi --

On Thu, 31 Mar 2005, Navindra Umanee wrote:

> Florian Gross <flgr / ccan.de> wrote:
>> I thought the original post would answer that well enough already, but
>
> Well, someone clarified what the problem was...  he was assigning to
> the class variables for Module instead of for the class itself.  I
> guess "self" is what is confusing.
>
>> in my own Ruby experience I have so far being surprised when using them.
>> Why should they be used when you can use far simpler constructs with
>> clearer rules?
>
> Well, the idea is to have shared storage for all objects of a
> particular class, right?  Class variables fit exactly that
> requirement.

As long as you add "... and possibly objects of another class" :-)
It's that inheritance thing, at least in large part, that causes
people to find class variables awkward.


David

-- 
David A. Black
dblack / wobblini.net