[m-dev.] :- interface declarations in submodules

Fergus Henderson fjh at cs.mu.OZ.AU
Thu Sep 9 20:03:49 AEST 2004


On 06-Sep-2004, Julien Fischer <juliensf at cs.mu.OZ.AU> wrote:
> 
> Should the compiler be accepting code like the following
> 
> 	:- module foo.
> 
> 	:- interface.
> 
> 	:- type x == int.
> 
> 		:- module bar.
> 
> 		(**)
> 
> 		:- type y == int.
> 
> 		:- end_module bar.
> 
> or does module bar require its own interface declaration,
> at the spot marked (**)?

For non-nested modules, if neither ":- interface" nor ":- implementation"
is present, the compiler treats the section as if it began with
":- implementation".  At least that was the intent.  The rationale was
to make rapid prototyping a little easier by providing some reasonable
behaviour in the case where the user just wants to see if some code 
type-checks (or mode-checks, etc.) and hasn't gotten around to worrying
about the module system and putting in module declarations yet.

This behaviour was never really re-examined much when nested modules were
added.

-- 
Fergus Henderson                    |  "I have always known that the pursuit
                                    |  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