[m-dev.] Module qualification of typeclass methods

Peter Ross peter.ross at miscrit.be
Tue Nov 20 22:26:38 AEDT 2001


On Tue, Nov 20, 2001 at 08:28:11PM +1100, Fergus Henderson wrote:
> 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?
> 
I was worried about efficiency.  At the time I was thinking that we
would try and model the entire System namespace as one sub-module
hierachy.  That is obviously a bad design choice, and not a good reason
to oppose this suggestion.

So in summary I don't think it is a valid objection anymore.

> 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.
> 
I was assuming that.

Pete
--------------------------------------------------------------------------
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