From: "Thomas R. Corbin" Date: 2001-12-06T02:04:45+09:00 Subject: [ruby-talk:27567] Re: Package Naming Bryan Murphy wrote: >> >> >>I'm not sure what we should do, but I'm sure that RAA.succ should >>enforce it :-) >> >>I can't think of a great alternative to module hierarchies, though >>such hierarchies tend to have an element of arbitrariness to them. >>Not through slopiness -- just because things don't always fall neatly >>into categories or name paths. >> >>It may be, though, that this would not matter too much if there were >>ways to index and search things that were orthogonal to the actual >>names. For example, if I'm looking for text processing modules, that >>could include XML-related modules. I could then just live with it if >>what I found happened to be called XML::Something::Whatever instead of >>Text::Something::Whatever. >> > I always wondered why something has to be part of a particular > namespace. I wrote a web application (currently in the slow process of > updating it) that lets you take your bookmarks and categorize them > (without having to make multiple copies of each bookmark). You can take > a look at my links here: http://links.terralab.com/view/bryan/ > > 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.