Version française
Home     About     Download     Resources     Contact us    

This site is updated infrequently. For up-to-date information, please visit the new OCaml website at

Browse thread
Nesting Modules
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Daniel_Bünzli <daniel.buenzli@e...>
Subject: Re: [Caml-list] Nesting Modules

Le 2 nov. 05 à 10:46, Richard Jones a écrit :

> If you want clean, hierarchical names it's much better to use '_' to
> separate the hierarchies (eg. Top_Bottom).  The reason for this is
> that it allows others to extend your hierarchy by adding other modules
> (eg. someone else can easily then create Top_MyExtension).

This doesn't scale well, suppose that I want to extend Top_Bottom,  
then I have a module called Top_Bottom_Myextension. I think 'include'  
is a better mechanism if you need to extend modules.

Another problem of this solution is that you cannot open modules  
hierarchically, e.g. open Top but use the dot notation for Bottom.