[m-dev.] Re: diff: Mmake support for nested modules
Fergus Henderson
fjh at cs.mu.OZ.AU
Thu May 28 00:03:19 AEST 1998
On 27-May-1998, Tyson Richard DOWD <trd at cs.mu.OZ.AU> wrote:
> Fergus Henderson <fjh at cs.mu.OZ.AU> writes:
>
> >doc/reference_manual.texi:
> > Update the "implementation bugs and limitations" section.
>
> >NEWS:
> > Update the news about nested modules.
>
> You didn't post this part of the diff.
Ah, good thing someone is keeping me honest ;-)
Sorry about that. Here it is.
Index: ../NEWS
===================================================================
RCS file: /home/mercury1/repository/mercury/NEWS,v
retrieving revision 1.101
retrieving revision 1.102
diff -u -u -r1.101 -r1.102
--- NEWS 1998/04/27 03:59:23 1.101
+++ NEWS 1998/05/27 04:00:24 1.102
@@ -246,19 +246,24 @@
* Mode inference can now infer "mostly-unique" modes as well as
"unique" modes.
-* The module system now includes support for logically nested sub-modules
- with separate compilation.
+* The module system now includes support for nested sub-modules
+ with optional separate compilation.
- The aim of this extension is to provide better support for structuring
- large software packages.
+ The aim of this extension is twofold: to provide better support
+ for structuring large software packages, and to provide
+ more fine-grained encapsulation.
- Modules may now contain `:- include_module' declarations.
- If a module `foo' contains an `include_module bar' declaration,
- this specifies that module `foo' contains the sub-module `foo:bar'.
- Since a sub-module is logically part of the containing module,
- it has access to all the entities declared in or imported into
- the containing module, including those declared in the implementation
- section.
+* The module system now includes support for sub-modules.
+
+ The aim of this extension is twofold. One aim is to provide more
+ fine-grained encapsulation control: nested sub-modules within a
+ single source file provide a convenient method for encapsulating
+ units smaller than a source file. The other aim is to provide better
+ support for structuring large software packages that consist of many
+ source files. Sub-modules can be defined in separate files, with
+ separate compilation, which means that you can also use this feature
+ to combine a group of existing Mercury modules into a single logical
+ package, with proper namespace control and encapsulation.
See the "Modules" chapter of the Mercury language reference manual for
details.
Index: ../doc/reference_manual.texi
===================================================================
RCS file: /home/mercury1/repository/mercury/doc/reference_manual.texi,v
retrieving revision 1.92
retrieving revision 1.93
diff -u -u -r1.92 -r1.93
--- reference_manual.texi 1998/05/23 19:48:30 1.92
+++ reference_manual.texi 1998/05/27 04:00:45 1.93
@@ -891,7 +891,7 @@
; @{ @{ int @} @}.
@end example
-This defines a type with two constructors, @code{';'}/2 and @code{'@{@}'/1},
+This defines a type with two constructors, @code{';'/2} and @code{'@{@}'/1},
whose argument types are all @code{int}.
Each discriminated union type definition introduces a distinct type.
@@ -2705,14 +2705,17 @@
@node Implementation bugs and limitations
@subsection Implementation bugs and limitations
-The current implementation of sub-modules is incomplete.
-In particular:
+The current implementation of sub-modules has a couple of minor
+limitations.
@itemize @bullet
- at item it supports only separate sub-modules, not nested sub-modules;
- at item if you mix an @samp{import_module} declaration for a parent module
- with a @samp{use_module} declaration for the child, or vice versa,
- then the compiler may report some spurious errors.
+ at item
+if you mix an @samp{import_module} declaration for a parent module
+with a @samp{use_module} declaration for the child, or vice versa,
+then the compiler may report some spurious errors.
+ at item
+Using @samp{mmake} to do parallel makes (e.g. @samp{mmake --jobs 2})
+don't always work correctly in the case of nested sub-modules.
@end itemize
@node Type classes
--
Fergus Henderson <fjh at cs.mu.oz.au> | "I have always known that the pursuit
WWW: <http://www.cs.mu.oz.au/~fjh> | of excellence is a lethal habit"
PGP: finger fjh at 128.250.37.3 | -- the last words of T. S. Garp.
More information about the developers
mailing list