From: "Thomas R. Corbin" Date: 2001-12-06T02:44:51+09:00 Subject: [ruby-talk:27576] Re: Package Naming David Alan Black wrote: > Hello -- > > On Thu, 6 Dec 2001, Thomas R. Corbin wrote: > >> Bryan Murphy wrote: >> >> > Now, I don't see why Modules and Namespaces have to behave exactly the >> > way they do. Why not something like this? >> > >> > module MyXMLConfigModule >> > module_alias Text::XML::MyXMLConfigModule >> > module_alias XML::Text::MyXMLConfigModule >> > module_alias Configuration::Tools::MyXMLConfigModule >> > end >> > >> > require 'Text/XML/MyXMLConfigModule' >> > works the same as >> > require 'XML/Text/MyXMLConfigModule' >> > >> > ? It would of course require some changes to Ruby, and some care would >> > need to be taken on behalf of the module maintainers, but the module >> > maintainers already do that anyway. At least those modules that got >> > into some sort of standard library could be guaranteed to be >> > consistent. >> > You could also do something for your apps like uninstalling >> > XML::Parsers::REXML, and replacing it with your own library that is >> > interface compatible and aliases to XML::Parsers::REXML even though it >> > isn't REXML. >> >> I really like your idea. It looks like it would add a lot of >> flexibility >> to a system. Of course, it could be abused, but then so could many >> things. >> I'd love to see your idea in ruby. > > It could certainly be abused. I'm trying to think of a situation > where it could just be *used* :-) > > If someone's written a drop-in replacement for REXML (or any other > large library or application of general interest), it seems to me that > that person would probably (I hope) want to share the new > implementation. That, in turn, would encourage whoever's written the > program that uses it to modularize their program so that either of the > two compatible auxiliary libraries could be used. > > Or am I being too Utopian? > > I suppose there may be examples of things like this being done > usefully, like MooTiff (which installs itself as libXm*), though > actually I don't think that's the same scenario. Well, what I liked was being able to take a complex hierarchy and simplify it quite a bit. I would only use something like that internally in a project where I'm using a part of a complex hierarchy and it gets annoying, or else the hierarchy is way different than I would do it, so I'd do a sort of internal hierarchy redesign. As for the replacing a module - I'm not sure about that, but I suppose I might actually take the original module and modify it slightly, either for debugging or real particular needs, where I don't think anyone else would be interested in my changes. With this I could get the system to use my version of the module. Of course, AspectR is a useful alternative in a lot of cases. Not real sure how realistic any of this is, just liking the ideas. > > > David >