From: Sven Schwyn Date: 2009-05-04T17:59:50+09:00 Subject: [ruby-core:23355] [Feature #1431] Object#__class__ Feature #1431: Object#__class__ http://redmine.ruby-lang.org/issues/show/1431 Author: Sven Schwyn Status: Open, Priority: Normal Category: core Consider the following code using class instance variables: class Car def self.total_count=(n) @total_count = n end def initialize self.class.total_count = 0 end end The compile requires "self.class.total_count" as the more readable "class.total_count" is mistaken by the parser as a faulty class definition. How about adding a __class__ method to Object? class Object def __class__ self.class end end It would allow the use of "__class__" as a de facto prefix for class instance variables and would fit e.g. the id/__id__ and send/__send__ paradigm. ---------------------------------------- http://redmine.ruby-lang.org