[m-rev.] for review: report errors for bad ":- end_module" declarations
Zoltan Somogyi
zoltan.somogyi at runbox.com
Thu Sep 4 09:36:02 AEST 2014
On Mon, 1 Sep 2014 16:45:37 +1000 (EST), Julien Fischer <jfischer at opturion.com> wrote:
> I suggest listing the cases separately, something like:
>
> For such sub-modules an error will occur if the interface contains any
> of the following:
>
> * a declaration for a function or predicate
> * a declaration for a type, inst, mode or typeclass that is not also
> defined in the interface section
> * a declaration for a type class instance
> * a (doubly) nested sub-module
>
> The last bit concerning (doubly) nested sub-modules is a bit unclear too.
> Surely I can have (doubly) nested interface-only sub-modules, provided
> there is no violation of the previous three points.
I ran with this, modifying it slightly, so that this paragraph
now reads as follows.
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 empty implementation section will result in an error
if the interface section of a sub-module contains any of the following:
@itemize @bullet
@item
a declaration for a function or a predicate;
@item
an abstract declaration for a type, inst, mode or typeclass,
i.e.@ a declaration that does not itself serve as a definition
of that type, inst, mode or typeclass;
@item
an abstract declaration of a typeclass instance; or
@item
a (doubly, triply, etc) nested sub-module
(which perforce has only an interface section, and no implementation section)
and which contains any of the above.
@end itemize
I am committing this; the easiest way to review this diff is to edit the file
yourself :-)
Zoltan.
More information about the reviews
mailing list