<div dir="ltr">On Mon, Mar 4, 2013 at 7:19 AM, Alain Frisch <span dir="ltr"><<a href="mailto:alain.frisch@lexifi.com" target="_blank">alain.frisch@lexifi.com</a>></span> wrote:<br><div class="gmail_extra"><div class="gmail_quote">
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="im"><span style="color:rgb(34,34,34)">An alternative could be to specify on the command-line a set of .ns files, each of them containing a definition of the "namespace" it defines (the name used in the source code).  </span></div>
</blockquote><div style><br></div><div style>How about having a namespace include path?  If a namespace Foo were referenced in the source code, the file foo.ns would be searched for and used to define the Foo namespace.  Maybe even the corresponding compiled library could be in the subdirectory foo/ adjacent to the .ns file.  This could be made hierarchical later by looking for Foo#Bar as foo/bar.ns.  </div>
<div style><br></div><div style>In this world, library installation would be similar to how findlib works, with each project installing a namespace file and a bunch of program objects.  </div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div class="im"></div>
In this variant of the proposal, we could almost get rid of -I flags for deployed libraries.<span class="HOEnZb"><font color="#888888"><br>
<br></font></span></blockquote><div style>The idea of getting rid of -I (for the common case) is one I'm strongly behind.  There's no good reason to make it hard to use external libraries.</div><div style><br></div>
<div style>This way of using namespaces may even allow something unexpected: private modules.  When a namespace provides the "interface" to a library, it might avoid specifying certain modules implemented by that library.  These compunits would still be linked in because of dependencies from other compunits in the project, but would not be made available to the namespace-using program because the environment modification caused by the namespace doesn't make them available.</div>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="HOEnZb"><font color="#888888">
<br>
<br>
Alain</font></span><div class="HOEnZb"><div class="h5"><br>
______________________________<u></u>_________________<br>
Platform mailing list<br>
<a href="mailto:Platform@lists.ocaml.org" target="_blank">Platform@lists.ocaml.org</a><br>
<a href="http://lists.ocaml.org/listinfo/platform" target="_blank">http://lists.ocaml.org/<u></u>listinfo/platform</a><br>
</div></div></blockquote></div><br></div></div>