[m-dev.] Module qualification of typeclass methods

Tyson Dowd trd at cs.mu.OZ.AU
Tue Nov 20 13:24:05 AEDT 2001


On 20-Nov-2001, Fergus Henderson <fjh at cs.mu.OZ.AU> wrote:
> On 15-Nov-2001, Peter Ross <peter.ross at miscrit.be> wrote:
> >
> > The only drawback to this approach is that you lose the sub-module
> > qualifier.  I would argue that this information is useful.
> 
> If that information is useful, then what's wrong with just putting in
> all the `:- import_module' declarations?

It is useful at the time of use, but not at the top of the module in the
import_module section.

At the time I use a method, it's very important for me to be sure I am
using the correct one, and that it is the right name and has the right
type and so on.  So I would be quite happy to write out the full name
in many cases (although I might rely on overloading in some cases too).

In a later email Simon says:
> I think it's reasonable that if you want to qualify references to
> an item using a module's name then you should have to explicitly
> import that module.

(this is a different idea, not talking about putting in *all* the :-
import_module declarations)

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 thought this might come up quite a bit as functions in different
sub-modules might have the same name and types, so we are going to have to
distinguish them somehow. 

I'm not sure why you believe it is "reasonable" in this case.
Do you believe it is only "reasonably" painful -- i.e. not too much of a
burden on the programmer?
Or do you think it is "reasonable" software engineering practice? (and
why, for what gain?)

-- 
       Tyson Dowd           # 
                            #  Surreal humour isn't everyone's cup of fur.
     trd at cs.mu.oz.au        # 
http://www.cs.mu.oz.au/~trd #
--------------------------------------------------------------------------
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