From: Paul Lutus Date: 2006-12-05T02:35:05+09:00 Subject: Re: FastRI, handling identical class names and methods Daniel Berger wrote: > > Paul Lutus wrote: >> Daniel Berger wrote: >> >> > Hi, >> > >> > FastRI 0.2.1 >> > Ruby 1.8.5 >> > Windows XP >> > >> > With FastRI (or rather, fri) how do you distinguish a lookup on classes >> > with identical names and methods (and no namespace to distinguish >> > them)? >> > >> > For example, I have the Pathname class from the stdlib and my own >> > Pathname class from the 'pathname2' package. If I do 'fri >> > Pathname#descend' I get the documentation from the Pathname class in >> > the >> > stdlib instead of my own. Is there a way to force the issue? >> >> Yes, there is. The best solution is to give your own class a different >> name. It is not a good idea to use an existing class name for your own >> classes. > > My class is meant as a replacement for the one in the stdlib. IMHO this is an even better reason to avoid a name collision. You may eventually create a situation in which people will install your class or library along with others and not realize that you have allowed a class name conflict. This can produce an inability to sort out what is going on, to determine which class is actually being invoked, from one system to another, due to differences in paths and other factors that could produce different outcomes for what appear to be identical libraries and installations. When Mr. Gray, a regular in this newsgroup, decided to replace the standard CSV management library with his own, he did not call it "CSV" (the existing name), he called it "FasterCSV". As I understand it, part of the reasoning was his wish to clearly identify his own work, part was a wish not to create a name collision. This is just my opinion, reasonable people may differ. -- Paul Lutus http://www.arachnoid.com