On 2007-07-24, dblack / wobblini.net <dblack / wobblini.net> wrote:
>
> On Tue, 24 Jul 2007, Jeremy Henty wrote:
>
>> On 2007-07-24, Robert Klemme <shortcutter / googlemail.com> wrote:
>>
>>> If you mean static variables that are visible in a single method
>>> only, then no, there is no way to do it.
>>
>> class Foo
>>  count = 0
>>  define_method(:foo) { count += 1 }
>> end
>
> "Static" is a misleading term, though.  It's just a local variable
> that happens to get wrapped in a closure.  

True, but it is still "visible in a single method only", which AIUI
Robert Klemme claimed was undoable.  Even though Ruby doesn't have
truely static variables, it can create something that behaves very
like (a common use case of) them.  That's all I'm claiming.

Regards, 

Jeremy Henty