[m-dev.] Module qualification of typeclass methods

Peter Ross peter.ross at miscrit.be
Thu Nov 15 20:14:54 AEDT 2001


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:
> > So I propose that we overload the meaning of an `:- include_module'
> > which appears in the interface section of a module to mean that you
> > should also automatically import that module.
> 
> I think that would be a bad idea.
> It would mean that there was a semantic difference between
> nested sub-modules and separate sub-modules, which I don't
> think is a good idea.  I also think it would be bad to make
> `:- include_module' do two different things at the same time.
> 
One I propose to allow include_modules declarations for nested
sub-modules.  An include_module for a nested sub-module in the interface
will have exactly the same effect as for a seperate sub-module (except
that the compiler is smart enough to figure out it already has the
module).  An include_module in the implementation does nothing.  Note
that currently the Mercury compiler accepts include_module declarations
for sub-modules.  This needs to be fixed otherwise.

One Simon has added a section about the difference between
implementation and interface sub-modules to the reference manual.  The
compiler doesn't obey these rules.  I have used implementation
sub-modules from modules that weren't the parent module.  This will also
need to be fixed if we don't add to the meaning of include_module.

Assuming that we want to use another key-word which I also have no
problem with.  What should we use?  I favour `:- automatically_include'.
I quite like the idea of only allow sub-modules to be automatically
included, but I guess it doesn't really matter.

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