Hi,

At Fri, 23 Sep 2005 09:31:39 +0900,
jdm wrote in [ruby-talk:157197]:
> i'm trying to create what C calls a static local variable inside a particular
> method, i.e. this variable should not be visible outside the method and its
> value should survive the activation of the method.

I'd suggested EVAL_ONCE but not accepted yet.

Only thing evaluated once is regexp with o option, so possible
alternative is using instance variables of Regexp.

def foo
  static = //o
  svar = static.instance_eval {
    @foo ||= some_method
  }
end

-- 
Nobu Nakada