From: Alan Chen Date: 2002-02-01T02:13:07+09:00 Subject: Re: strange behavior On Thu, Jan 31, 2002 at 11:05:12PM +0900, mengx@nielsenmedia.com wrote: > Looks like I have to yield since matz is doing this way. > Now back to the starting question of making class method accessible > in instance without having to use qualifier. Would it be possible to > do this way by first looking up for instance method and if not, > look up for the class method. This could avoid name conflict. > What would be pitfall for this? > > Thanks > > -Ted > > > > Well, there are plenty of examples in the standard library > > > > Array#[], Array.[] > > File#atime, File.atime > > File#chmod, File.chmod > > ... etc > > > > Sometimes, having the same name makes a lot of sense. > > > > // Niklas I think that requiring the qualifier is desireable because it maintains the clarity betwen class and instance methods. As Niklas pointed out, there are times when using the same name between class#method and class.method makes sense. Automatically falling back to #method if .method doesn't exist would, I think, add a special case to the parser and may lead to suprising and undesirable results. -- alan -- Alan Chen Digikata LLC http://digikata.com