From: Robert Dober Date: 2007-07-24T21:06:02+09:00 Subject: Re: Static variables in Ruby. On 7/24/07, Jeremy Henty wrote: > On 2007-07-24, Robert Klemme wrote: > > > If you mean static variables that are visible in a single method > > only, then no, there is no way to do it. > > *cough* > > class Foo > count = 0 > define_method(:foo) { count += 1 } > end > x = Foo.new > 3.times { puts x.foo } > > ==> > 1 > 2 > 3 > > Regards, > > Jeremy Henty > > closure based properties, what a nice idea ;) Terribly slow BTW :( Robert -- I always knew that one day Smalltalk would replace Java. I just didn't know it would be called Ruby -- Kent Beck