Var scope question

Is it correct to say that class variables '@@' are similar to globals in that they are global to their class?

Hi --

···

On Sun, 19 Mar 2006, rtilley wrote:

Is it correct to say that class variables '@@' are similar to globals in that they are global to their class?

Their class, and subclasses of their class. They're pretty
global-ish. That's scheduled to be fixed^H^H^H^H^H^H^Hchange in Ruby
2.0, when they'll be visible only to their class/module and the
instance methods inside it (as I understand Matz's description).

David

--
David A. Black (dblack@wobblini.net)
Ruby Power and Light, LLC (http://www.rubypowerandlight.com)

"Ruby for Rails" chapters now available
from Manning Early Access Program! Ruby for Rails

dblack@wobblini.net wrote:

Their class, and subclasses of their class. They're pretty
global-ish. That's scheduled to be fixed^H^H^H^H^H^H^Hchange in Ruby
2.0, when they'll be visible only to their class/module and the
instance methods inside it (as I understand Matz's description).

OK, thanks... about the time I fully understand it... things will probably change :slight_smile:

unknown wrote:

Hi --
global-ish. That's scheduled to be fixed^H^H^H^H^H^H^Hchange in Ruby
2.0, when they'll be visible only to their class/module and the
instance methods inside it (as I understand Matz's description).

Any sense of when 2.0 might be released?

Jeff

···

--
Posted via http://www.ruby-forum.com/\.