[m-dev.] Module qualification of typeclass methods

Simon Taylor stayl at cs.mu.OZ.AU
Tue Nov 20 15:52:38 AEDT 2001


On 20-Nov-2001, Tyson Dowd <trd at cs.mu.OZ.AU> wrote:
> I think it is still valuable to have the full name of an object
> 
> 	Name = 'System__ServicedComponent__DisposeObject'(O)
> 
> used when appropriate.  And it would still be annoying to have to 
> add the import_module for it when I want to do this. 

I see your point.

The only real difference between `:- include' and `:- auto_import'
is that `:- include' renames the items from the included module and
`:- auto_import' doesn't.

`:- include' is better where you want to treat the included modules
as a single unit, so losing the module qualifiers is actually an
advantage (e.g. extras/complex_numbers).

`:- auto_import' is better for small sub-modules introduced for a
typeclass so that the class methods can be qualified with the class
name, but where the class is logically part of the parent module.

A lot of the discussion so far has been concerned with using
`:- include' to achieve something that is better done using
`:- auto_import'. They can be considered to be minor variations
of the same feature, so why can't we just support both?

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