nested modules proposal (was: packages proposal)

Andrew Bromage bromage at cs.mu.OZ.AU
Fri Feb 13 10:41:04 AEDT 1998


G'day.

Fergus Henderson wrote:

> I spent a lot of time thinking about my packages proposal last night
> (couldn't sleep, actually), and I have come up with a new, simpler
> proposal which I think would in fact be easier to implement.
> So scrap the previous proposal, and replace it with this one.

I have a few comments.

> 1. Nested modules.
> ------------------
> 
> Syntax:
> 
> 	A module may contain sub-modules, delimited by
> 	`:- module' and `:- end_module declarations'.
> 
> 	Module names themselves be module-qualified.
                               ^
There's a qualifier missing.  Pick one of: must, should, may.

> 	(We should also add some new syntax for fully-qualified
> 	module names, e.g. `:m1:m2:foo', but I can't think
> 	of a workable syntax for it.)

I like that one, actually.  This way, the empty module name is sort
of the "root module".  However it doesn't work when using "__" as
a module qualifier.

Your suggestion doesn't mention private sub-modules.  Will we be
supporting them or not?

> 	The mapping between module names and file names is
> 	is implementation-dependent.

I'm not entirely happy about this.  You should be able to take some
Mercury source written under one implementation and compile it on
some other implementation without change.  The only part of the
compilation process that needs to understand this mapping, of course,
is `mmake depend'.

Apart from that, I like this scheme.  It's simple and it's flexible.

Cheers,
Andrew Bromage



More information about the developers mailing list