[m-dev.] :- interface declarations in submodules

Julien Fischer juliensf at cs.mu.OZ.AU
Mon Sep 6 19:02:18 AEST 2004


Should the compiler be accepting code like the following

	:- module foo.

	:- interface.

	:- type x == int.

		:- module bar.

		(**)

		:- type y == int.

		:- end_module bar.

or does module bar require its own interface declaration,
at the spot marked (**)?

The compiler currently accepts this but the short interfaces it generates
are different in both cases.  Without bar's interface declaration
the contents of foo.bar.int3 are as follows:

	:- module (foo.bar).

With the interface declaration they are.

	:- module (foo.bar).
	:- interface.
	:- type y == int.

The other interface files, .int0, .int2 and .int are the
same in both cases.

Playing around with this further reveals that the following
variation also exhibits some funny behaviour with short
interfaces:

	:- module foo.

	:- interface.

	:- type x == int.

	:- implementation.

		:- module bar.

		<**>

		:- type y.

		:- implementation.

		:- type y == int.

		:- end_module bar.A

Unless there is some sort of (undocumented) notion
of an implicit interface for submodules the compiler
presumably ought to be rejecting this sort of thing outright?

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