var scope question

R

rtilley

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

dblack

Hi --

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 ([email protected])
Ruby Power and Light, LLC (http://www.rubypowerandlight.com)

"Ruby for Rails" chapters now available
from Manning Early Access Program! http://www.manning.com/books/black
 
R

rtilley

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 :)
 
J

Jeff Cohen

unknown said:
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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,202
Messages
2,571,057
Members
47,667
Latest member
DaniloB294

Latest Threads

Top