[m-dev.] Module qualification of typeclass methods

Fergus Henderson fjh at cs.mu.OZ.AU
Wed Oct 31 18:53:07 AEDT 2001


On 31-Oct-2001, Peter Ross <peter.ross at miscrit.be> wrote:
> The idea of different include_module is a good idea.  I intend to work on it
> today.

OK, but I don't think we have any concensus on this yet.  So I don't
think it would be a good idea to leap into implementation just yet.
I presume you'll start by documenting the syntax and semantics of the
new construct, and posting that for review?

I have an alternative proposal, which was part of my original proposal
for nested modules.  This proposal is to have a new construct

	:- export_module <module name>.

which includes the *contents* of the specified module in the current module.
(Maybe `export_module' isn't the best name for it.
Other possible names include `export_module_contents',
`module_contents', `copy', and `include'.)

When used in combination with include_module, it has the same effect
as this proposal for a different include_module.  But it can also be
used for other purposes, e.g. to rename modules, or to combine modules.

	% renaming a module:
	:- module new_name_for_foo.
	:- interface.
	:- export_module foo.
	:- end_module new_name_for_foo.

	% combining two modules into a single module:
	:- module foo.
	:- interface.
	:- export_module bar.
	:- export_module baz.
	:- end_module foo.

-- 
Fergus Henderson <fjh at cs.mu.oz.au>  | "... it seems to me that 15 years of
The University of Melbourne         | email is plenty for one lifetime."
WWW: <http://www.cs.mu.oz.au/~fjh>  |     -- Prof. Donald E. Knuth
--------------------------------------------------------------------------
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