From: Paul Brannan Date: 2002-01-31T06:57:42+09:00 Subject: Re: strange behavior On Thu, Jan 31, 2002 at 06:44:34AM +0900, Chr. Rippel wrote: > Why not do this? > > class A > def self.b > A.a > end > end > > b.b # => A.a IMO, a method should not have to know the name of the class in which it is defined. If I change the name of the class, then I must be very careful to make sure that I also change any code inside the class definition that uses the original name. Additionally, if I cut-and-paste a function from one class to another, then I must also be careful. In theory, changing a class name isn't (or shouldn't) be done often, and I should really consider why I am using cut-and-paste anyway instead of designing my code properly in the first place. A wise person once said, though, that the diffence between theory and real life is real life. Paul