[m-dev.] Module qualification of typeclass methods

Fergus Henderson fjh at cs.mu.OZ.AU
Thu Nov 15 20:21:31 AEDT 2001


On 15-Nov-2001, Peter Ross <peter.ross at miscrit.be> wrote:
> On Thu, Nov 15, 2001 at 04:43:39PM +1100, Fergus Henderson wrote:
> > On 14-Nov-2001, Peter Ross <peter.ross at miscrit.be> wrote:
> > > On Tue, Nov 13, 2001 at 08:14:24PM +1100, Fergus Henderson wrote:
> > > > On 12-Nov-2001, Simon Taylor <stayl at cs.mu.OZ.AU> wrote:
> > > > > This `:- include' proposal doesn't solve the problem of
> > > > > including all of the sub-modules of modules such as
> > > > > extras/complex_numbers/complex_numbers.m,
> > > > 
> > > > Sure it does, just put an `:- include' declaration in the parent module
> > > > that includes the appropriate child modules.
> > >
> > > I don't think it does solve the problem.  You stated before that an
> > > export_module declaration will override the namespace qualifiers with
> > > that of the current module, so for every sub-module you include using
> > > this mechanism will lose its sub-module qualifier.  Probably leading to
> > > name conflicts, which is the reason why you put it an item in a
> > > sub-module in the first place.
> > 
> > For cases like extras/complex_numbers, the ambiguity will be
> > resolved by the types of the arguments.
>
> Currently we don't allow overloading of predicates with the same name
> and arity in the same module.  So assuming the arity is the same I don't
> see how we would resolve the ambiguity.

The idea is that we would effectively allow overloading of predicates
with the same name and arity iff the overloading was introduced via a
`:- include' declaration.

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