for review: add nested modules [5/5]

Simon Taylor stayl at cs.mu.OZ.AU
Mon Mar 2 11:48:49 AEDT 1998


In addition to dgj's comments:

>-An @code{implementation} declaration specifies
>+this section specifies the entities that are exported by this module.
>+Mercury provides support for abstract data types, since the
>+definition of a type may be kept hidden, with only the type
>+name being exported.

... by allowing the definition of a type to be kept hidden ...?

>+It is an error to declare a sub-module twice, or to define it twice.
>+It is an error to define a sub-module without declaring it.
>+If a sub-module is declared but not explicitly defined,
>+then there is an implicit definition with an empty implementation section
>+for that sub-module (this will result in an error, if the interface
>+section includes declarations but not definitions for any types,
>+preds, modes, or (doubly) nested sub-modules).

s/preds/predicates.

>Index: tests/invalid/bigtest.err_exp
>===================================================================
>RCS file: /home/mercury1/repository/tests/invalid/bigtest.err_exp,v
>retrieving revision 1.1
>diff -u -u -r1.1 bigtest.err_exp
>--- bigtest.err_exp	1996/11/04 07:14:34	1.1
>+++ bigtest.err_exp	1998/02/25 05:29:01
>@@ -1,4 +1,4 @@
>-bigtest.m:001: Warning: module should start with a `:- module' declaration.
>+bigtest.m:001: Warning: module should start with a `:- module' declaration: :- export_sym list / 1, append / 3, member.

I'm not sure that including the first item actually improves the
error message here.



More information about the developers mailing list