Proposal: module namespaces.

Ketil Malde [email protected]
27 Feb 2001 11:42:58 +0100


Malcolm Wallace <[email protected]> writes:

> Proposal 1
> ----------
> Introduce nested namespaces for modules.  The key concept here is to
> map the module namespace into a hierarchical directory-like structure.
>   * The use of qualified imports becomes more verbose: for instance
        [...]
>     instance, either the fully-qualified or abbreviated-qualified names
>             Text.Xml.Parse.element
>             Parse.element
>     would be accepted and have the same referent, but a partial
>     qualification like
>             Xml.Parse.element
>     would not be accepted.

Why not?

Perhaps one could have a warning/error if there are multiple "Parse"
modules? 

>   * Another consequence of using the dot as the module namespace
>     separator is that it steals one extremely rare construction from
>     Haskell'98:
        [...]
>     No-one so far thinks this is any great loss, and if you really
>     want to say the latter, you still can by simply inserting spaces:
>             A.B . C.D

Personally, I'm not overly enthusiastic about using (.) for function
composition - but I guess e.g the degrees sign was ruled out since
it's not in (7bit) ASCII - and I think it should require spaces
anyway, in order to differentiate it from its other uses.

> Proposal 2
> ----------
> Adopt a standardised namespace layout to help those looking for or
> writing libraries, and a "Std" namespace prefix for genuinely
> standard libraries.  (These are two different things.)

Sounds good!

-kzm
-- 
If I haven't seen further, it is by standing in the footprints of giants