[m-dev.] Module qualification of typeclass methods

Fergus Henderson fjh at cs.mu.OZ.AU
Tue Nov 20 20:28:11 AEDT 2001


On 30-Oct-2001, Peter Ross <peter.ross at miscrit.be> wrote:
> Simon wrote:
> > Would it be better to add an `import_package' declaration, which
> > is like `import_module', but also imports all sub-modules of the
> > imported modules.
>
> This could be problematic when you have a very large hierachy of sub
> modules.  For instance if you want to use the System namespace in .NET you
> would also have to load in all the children namespaces.  This would be huge,
> so maybe it is not such a great idea because it could lead to too much
> importing.

I'm not sure what problem you're worried about here.
Is it namespace polution, or efficiency?

If we're going to have `import_package', then we should also have
`use_package', which would be to `use_module' what `import_package'
is to `import_module'.  For cases where there is a very large hierarchy
of sub-modules, you could use `use_package'.  That would avoid the
namespace pollution problem.

-- 
Fergus Henderson <fjh at cs.mu.oz.au>  |  "I have always known that the pursuit
The University of Melbourne         |  of excellence is a lethal habit"
WWW: <http://www.cs.mu.oz.au/~fjh>  |     -- the last words of T. S. Garp.
--------------------------------------------------------------------------
mercury-developers mailing list
Post messages to:       mercury-developers at cs.mu.oz.au
Administrative Queries: owner-mercury-developers at cs.mu.oz.au
Subscriptions:          mercury-developers-request at cs.mu.oz.au
--------------------------------------------------------------------------



More information about the developers mailing list