From: Patrick Doyle Date: 2008-10-08T01:53:08+09:00 Subject: Re: class << self ------=_Part_55589_10216295.1223398473270 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline Returning to this topic after a brief hiatus being distracted by other concerns... Would it be fair to say that 99% of the time there is no difference between the definitions of A#a, A#b, and A#c? class A def self.a puts "self.a" end def A.b puts "A.b" end class << self def c puts "A.c" end end end It seems that the construct: class << self def x end def y end def z end end might be used primarily as a typing shortcut and that 99% of the time that's all it is. Would it be fair to say that 100% of the time there is absolutely no difference between A#a and A#b? Is it fair to say that the 1% of the time that there's a difference between A#a and A#c is for constant lookup? FWIW, I do see a difference between class A class << self def blah end end end and something = A.new() class << something def something_very_specific_to_this_something() end end and that's a nifty trick. Someday I might even find myself coding something that just cries out for that trick. Thanks Suraj for showing that to me. --wpd ------=_Part_55589_10216295.1223398473270--