From: Dan Hable Date: 2001-12-06T13:43:48+09:00 Subject: [ruby-talk:27593] Re: Package Naming >> > module MyXMLConfigModule >> > module_alias Text::XML::MyXMLConfigModule >> > module_alias XML::Text::MyXMLConfigModule >> > module_alias Configuration::Tools::MyXMLConfigModule >> > end I do like the idea of creating an alias, but should the module author be responsible for creating the alias? I would rather be allowed to create an alias within my end program like: module_alias pkg1::MyXMLConfigModule Text::XML::MyXMLConfigModule module_alias pkg2::MyXMLConfigModule2 Dan::Text::XML::MyXMLConfigModule This prevents a few problems: 1) Ruby doesn't need to take the extra time when starting to scan through all of the modules that may exist and create a complex reference structure to find any module. I'm looking at using Ruby in an embedded project and I could live without a lot of processing overhead. 2) This allows the end user to redefine the name clash. I could see some developers creating all kinds of combinations for their modules. If the end user had the power to create an alias, then end users know how polluted the namespaces are. This could also be expanded to allow aliases to take president over hard references to module names. This means if you create an alias to another XML parser and alias it to XML::Parsers::REXML, then if your script calls for REXML, you get the new parsers (assuming they have the same interface). Dan