From: Ged Byrne Date: 2003-08-21T22:31:32+09:00 Subject: Re: Class variables - a surprising result > I think it's simpler than that: you're just > assigning to a variable. It's probably is simpler. I'm afraid I'm still thinking in Java. > There no such thing: > > $ ruby cvars.rb > cvars.rb:3: syntax error > writer: @@x > ^ > > [...] Ooops, need to be more careful undoing after my experiments. Delete the writer: @@x line for the code to work. > > > So whats the best approach in ruby? To keep a > class > > hash that contains a value associated with each > class? > > Over on IRC (irc.freenode.net, channel #ruby-lang) > we've just > been chatting about class instance variables, which > are the > best way to achieve true per-class state > maintenance. They've > been talked about here a number of times; you can > search on > www.ruby-talk.org or Google. Or join us on IRC :-) > > Thanks, I'm off to google. Wish IRC was an option :-( > David > > -- > David Alan Black > home: dblack@superlink.net > work: blackdav@shu.edu > Web: http://pirate.shu.edu/~blackdav > > Ged. ________________________________________________________________________ Want to chat instantly with your online friends? Get the FREE Yahoo! Messenger http://uk.messenger.yahoo.com/