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

Alain Frisch alain.frisch at lexifi.com
Tue Feb 26 18:14:06 GMT 2013


On 2/26/2013 5:53 PM, Yaron Minsky wrote:
> I very much disagree.  This is a common enough primitive that people
> should be able to do it without hacking the build system.  Indeed,
> Daniel seems to have the same requirements as we do.

I'd say "using" the build system rather than hacking it.  Actually, it 
is more about using ocamlfind.  We will anyway need to rely on ocamlfind 
to manage the installation of many libraries, right?  I think that users 
don't really care that passing "-package core" to ocamlfind will result 
in it passing the following three options to the compiler:

   -I ..../core/core.ns
            (* To "open" the the default mapping provided by core *)

   -open Core_std
            (* To open the default module which, in particular,
               overrides definitions in Pervasives. *)

   -I ..../core
            (* So that you can use long names like Core_list if you
               wish, to be explicit *)

(and probably some -ppx options as well :-))


(There could variants like a "-package core.raw" which would only pass 
the third one.)

Do you agree that the information about which libraries are used by a 
specific part of the code base will be part of the build system anyway?

Now we could discuss putting library-related information in the client 
code itself (this is a common request for "syntax extensions", but I 
don't see why this is specific to them), e.g. in the form of special 
comments/attributes understood by ocamlfind, but this seems a different 
topic to me.



Alain


More information about the Platform mailing list