From: "David A. Black" Date: 2007-09-22T22:32:47+09:00 Subject: Re: question re: modules and class variable scope Hi -- On Sat, 22 Sep 2007, Todd Benson wrote: > On 9/22/07, David A. Black wrote: >> Hi -- >> >> On Sat, 22 Sep 2007, Gary Wright wrote: >> >>> So despite the fact that class variables and instance variables both >>> use a similar syntactical sigil (@@ vs @), they are scoped in vastly >>> different ways. >> >> I honestly wish that class variables looked like $$this, rather than >> @@this. They're so completely unrelated to, and radically different >> from, instance variables, whereas they're much more akin to globals. >> The @/@@ thing has caused more confusion than anything else in Ruby, I >> believe. > > I'm in no place to disagree with David, but I should point out that $$ > suggests superiority over $ globals. People in many places have disagreed with me, and I with them. Feel free :-) At least $$this would point the confusion away from instance variables, which are much more important and more deserving of not being made confusing than globals. Not that I think confusion is good in any direction. What I'd like most is for class variables to disappear from Ruby, but I don't think that's going to happen. David -- Upcoming training from Ruby Power and Light, LLC: * Intro to Ruby on Rails, Edison, NJ, October 23-26 * Advancing with Rails, Edison, NJ, November 6-9 Both taught by David A. Black. See http://www.rubypal.com for more info!