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

Xavier Clerc xavier.clerc at inria.fr
Fri Feb 22 21:51:25 GMT 2013


----- Mail original -----
> 
> Le vendredi, 22 février 2013 à 20:04, Xavier Clerc a écrit :
> > I beg to differ. My understanding is that we
> > need to be able to gather several modules
> > under a name *without* crafting a new
> > module in the process.
> 
> Why exactly ? What's the problem if a new module is crafted in the
> process ? For me the problem seems only to be related to the way
> modules are linked in (the "pack problem" to give it a name). From a
> conceptual perspective I see absolutely no other, orthogonal,
> concept at play and hence see no reason to introduce a new one in
> the core language.

Well, as you point out, once you have built a full-fledged module,
you cannot break it into pieces even if you are only interested in
some parts of it.

On the other hand, if namespaces are added to the language, "pack"
would still be useful, as you may sometimes actually need to build
a module from pieces -- e. g. in order to pass it to a functor.

So, as of today, we have :
  - "archives" (cma / cmxa) allowing to gather modules but without
    naming (at the language level) the gathering ; 
  - "packs" allowing to gather modules into a module.
I regard namespaces are gathering modules into a named entity but
without creating a module. Hence, it is a new beast, different from
archives and packs.


Xavier


More information about the Platform mailing list