From: khaines@... Date: 2006-08-19T06:24:20+09:00 Subject: Re: Class variables in Ruby On Sat, 19 Aug 2006, Daniel Waite wrote: >> @@cacheDescr = {} unless @@cacheDescr > > Or, to be more idiomatic: > > @@cache_descr ||= {} Which I usually prefer, but the variant that uses unless reads more like a sentence if a person isn't sure what's happening there. I wish I could use a simple structure like that for constants. Foo = 7 unless const_defined? :Foo is wordier than I like. Kirk Haines