[m-dev.] Module qualification of typeclass methods
Simon Taylor
stayl at cs.mu.OZ.AU
Fri Nov 23 05:18:52 AEDT 2001
On 23-Nov-2001, Fergus Henderson <fjh at cs.mu.OZ.AU> wrote:
> On 23-Nov-2001, Simon Taylor <stayl at cs.mu.OZ.AU> wrote:
> > On 22-Nov-2001, Peter Ross <peter.ross at miscrit.be> wrote:
> > > On Wed, Nov 21, 2001 at 12:10:39AM +1100, Simon Taylor wrote:
> > > > If the System.Data.{SqlClient,SqlTypes,OleDb,Common} modules are all used
> > > > then `:- import_package System.Data.*' might be appropriate, but I
> > > > shouldn't be tempted to import everything just to use some of the
> > > > basic classes (DataColumn, etc.) in System.Data. `:- auto_import'
> > > > should be used to import the modules for the basic classes.
> > > >
> > > I would argue that this is a packaging problem. The .NET library
> > > designers decided to put all these classes into one deployment unit
> > > (assembly).
> > >
> > > I would argue that the namespace pollution issue is due to bad library
> > > design, rather then a problem with the import_package declaration.
> >
> > I would argue that it's a bit of both.
> >
> > Any extension to the module system should gracefully handle libraries
> > which aren't organised in the ideal way (whatever that is).
> > As this example demonstrates, `:- import_package' does not.
>
> I don't find this example particularly convincing...
> just use `:- use_package'.
I don't think that's an acceptable solution.
Why do we have `:- import_module' at all?
Why shouldn't we be able to use it for the .NET library?
> Anyway, even if this example was serious problem,
> is `:- auto_import' going to solve it?
> The user of the package is at the mercy of the package designer.
> If the package designer didn't factor the modules well in the first place,
> what makes you think they're going to use `:- auto_import' well?
In this case it's not the package designer using `:- auto_import',
it's the .NET interface generation tool.
Designers of Mercury packages are likely to take more care that
their packages are easy to use with whatever module import
mechanisms Mercury has.
Simon.
--------------------------------------------------------------------------
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