lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


> When might I have a package that has the same name as a module?  And 
> would it be useful to require the module alone without getting the rest 
> of the package as well?  I can't think of any good example, but maybe 
> I'm just being unimaginative.

In Perl, for instance, you have a module called CGI and another called
CGI::Carp. You can use CGI without using CGI::Carp, the latter being a
kind of optional auxiliary module for the former.

Of course, there is nothing wrong with a main module that only imports
all sub-modules of that package, but this is just one possible design.

-- Roberto