[m-dev.] module system discussion

Simon Taylor stayl at cs.mu.OZ.AU
Tue Nov 20 02:49:42 AEDT 2001


On 19-Nov-2001, Peter Ross <peter.ross at miscrit.be> wrote:
> On Mon, Nov 19, 2001 at 05:53:33PM +1100, Fergus Henderson wrote:
> > S2. `:- include'.
> > 
> > 	There's a new declaration `:- include <Modules>',
> > 	where <Modules> is a list of fully-qualified module name.
> > 	This may only occur in either the interface or implementation
> > 	section.  The effect is that the entities declared in the
> > 	interfaces of the specified <Modules>, or *included* (directly
> > 	or indirectly) in those interfaces, are *included* in the
> > 	corresponding section of the containing module,
> > 	which means that they can be referred to as
> > 	if they were members of that section of the containing module.
> > 	(By "the containing module", I mean the module in which the
> > 	`:- include' declaration occurs.)
> > 
> The only drawback that I have come up to this proposal is the one that I
> have mentioned in the email
> 
> http://www.mercury.cs.mu.oz.au/mailing-lists/mercury-developers/mercury-developers.0111/0088.html

In that mail, Peter Ross wrote:
> 	The only drawback to this approach is that you lose the sub-module
> 	qualifier. I would argue that this information is useful.
> 
> 	I would much rather read
> 
> 	Name = 'System__ServicedComponent__DisposeObject'(O)
> 
> 		  then
> 
> 	Name = 'System__submodules__DisposeObject'(O)
> 
> 		  or even
> 
>       Name = 'System__DisposeObject'(O)
> 
>       if the `:- include' was located at the top level.
 
I think it's reasonable that if you want to qualify references to
an item using a module's name then you should have to explicitly
import that module.

Fergus has convinced me that `:- include' isn't much more difficult
to implement than `:- auto_import', and that the drawbacks of
`:- include' aren't as bad as I first thought, so I'm leaning
towards solution S2.

Simon.
--------------------------------------------------------------------------
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