Hi --

On Fri, 15 Nov 2002, Gennady F. Bystritsky wrote:

> Cool. Never thought of it this way. And what's the buzz in another thread
> about making them private? Does it mean that as it currently implemented you
> can access such variables even directly without accessor methods?

I think that's a different thing -- having instance variables (i.e.,
of non-class objects) be scoped to the class.  That would result
in:

  class A
    def learn
      @_x = 1
    end
  end

  class B < A
    def speak
      puts @_x
    end
  end

  b = B.new
  b.learn
  b.speak   # Currently prints 1
            # If @_x were "class local", the @_x in A and
            # the @_x in B would be different and this
            # would print nil.

At least that's how I understand that discussion.  So it's different
from (though might intersect with, in some cases) the thing about
a Class's own instance variables and accessors.


David

-- 
David Alan Black
home: dblack / candle.superlink.net
work: blackdav / shu.edu
Web:  http://pirate.shu.edu/~blackdav