From: David Alan Black Date: 2001-08-11T23:09:37+09:00 Subject: [ruby-talk:19528] Re: the way class variables work Hello -- On Sat, 11 Aug 2001 jweirich@one.net wrote: > In Smalltalk, there are two kinds of "class" variables. There are > class variables which work the way Ruby class variables work (shared > across an inheritance hierarchy). But there are also class *instance* > variables which are unique to the individual class object (instance) > where they are defined. > > It turns out that both types of class variables are supported in Ruby > as well... ... > Class variable mimic "static" variables in Java or C++. Class > instance variables are instance variables in the class object. > > I hope this helps. Yes, it does, along with some of the other responses and some irc remarks by matju and others. At least, I'm cured of wanting class variables to behave like class instance variables, since those already exist :-) But I'm still baffled, maybe more than ever, by the "why", that is, why class variables exist at all in Ruby. No one seems to have anything good to say about them. They seem to operate as a kind of not-quite-global global. They introduce weird, backwards dependencies. They come to your house at night, ring the doorbell, and run away. They.... [Cut to shot of David cowering in corner] David -- David Alan Black home: dblack@candle.superlink.net work: blackdav@shu.edu Web: http://pirate.shu.edu/~blackdav