[ocaml-platform] on the need and design of OCaml namespaces

Daniel Bünzli daniel.buenzli at erratique.ch
Fri Feb 22 18:40:08 GMT 2013


Le vendredi, 22 février 2013 à 17:40, Leo White a écrit :
> There is no real reason that something cannot be placed in two locations  
> within the hierarchy.

But as I suggested from the perspective of programming *in the language* there no point of having it at two different location. Even from the perspective of reading code it's confusing you have to learn all the places where a module may be and understand that all these modules are in fact the same.  

> I agree with this in general. However, there are some specific cases where
> a hierarchical namespace is very useful. For example:
>  
> 1. In some very large libraries, it is useful to be able to divide the  
> modules into sub-components that can opened individually.
>  
> 2. In some libraries it is useful to provide multiple versions of some  
> components (e.g. Foo.Async.Io and Foo.Lwt.Io).

For me all this should be solved within the realm of the module system. Maybe we need to fix the way we link things in (since that seems to be the only reason why -pack is not deemed reasonable). But I really see no point in introducing new namings mechanisms into the core language.

Daniel  




More information about the Platform mailing list