Modules (again)

Marcin 'Qrczak' Kowalczyk qrczak@knm.org.pl
30 Aug 2001 10:48:10 GMT


Thu, 30 Aug 2001 10:09:59 +0100, Simon Marlow <simonmar@microsoft.com> pisze:

> Am I the only one that thinks it's strange that
> 
> 	module M ( module A ) where
> 	import B as A
> 
> exports the contents of module B?  A isn't even a module!

A is a name of a module as far as this module source is concerned.
You can write A.whatever and names are qualified with module names,
so A must be considered a module name...

> The old definition claims that 'module M where' is the same as
> 'module M (module M) where' which is a nice property.  Perhaps we
> can clarify the definition so that this is the case.

Oops, it's indeed a problem.

> One way to do this is to make 'module M' exports refer to the actual
> module M, not including any modules renamed to M.

I would definitely not do that. A renamed module should be consistently
referred to by its new name. The only problem is whether 'module M where'
is specified in terms of where definitions come from or in terms of
source rewriting to 'module M (explicit export list) where'.

I can't decide. What could be the purpose of renaming a module into
the same name as the current module? What behavior would be more
useful then? I think that both variants are logically explainable,
so it should be decided on the basis of usefulness and expectability
(is "expectability" an English word?).

-- 
 __("<  Marcin Kowalczyk * qrczak@knm.org.pl http://qrczak.ids.net.pl/
 \__/
  ^^                      SYGNATURA ZASTĘPCZA
QRCZAK