From: nobu.nokada@... Date: 2001-12-05T12:50:03+09:00 Subject: [ruby-talk:27515] Re: Package Naming At Wed, 5 Dec 2001 08:18:25 +0900, 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' How can the interpreter know MyXMLConfigModule has aliases before require? Searching all of probable modules? Rather, what about this? $ cat XML/Text/MyXMLConfigModule.rb module XML module Text module MyXMLConfigModule # ... end end end $ cat Text/XML/MyXMLConfigModule.rb module Text module XML require 'XML/Text/MyXMLConfigModule' MyXMLConfigModule = ::XML::Text::MyXMLConfigModule end end $ ruby -rText/XML/MyXMLConfigModule -e 'p Text::XML::MyXMLConfigModule' XML::Text::MyXMLConfigModule Nobu Nakada