Hi,

At Tue, 4 Feb 2003 03:14:32 +0900,
ahoward wrote:
> > > [ruby-dev:19449] new keyword once
> > >
> > >   Matz considers that the better plan is to make string literal create
> > >   an object only once.
> 
> 
> why not a more general
> 
>   static <statement>
> 
> which heap allocates/evaluates statement once in the local scope - ananlogous
> to C's static.

This proposal doesn't mean what you want.  The value evaluated
with `once' can't be varied.

I guess your `method static' variable can be achieved as:

  def foo
    method_static = once [0]
    puts "called #{method_static[0]} times"
  end

-- 
Nobu Nakada