<p dir="ltr">This proposal makes me happy.</p>
<p dir="ltr">y</p>
<div class="gmail_quote">On Mar 15, 2013 9:43 AM, "Leo White" <<a href="mailto:lpw25@cam.ac.uk">lpw25@cam.ac.uk</a>> wrote:<br type="attribution"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Following recent discussions, I would like to propose some changes to my<br>
previous proposal:<br>
<br>
## Flat namespaces<br>
<br>
It has occured to me that, while I have some good use cases for<br>
hierarchical namespaces, they are not critical for the *initial*<br>
implementation of namespaces in OCaml. Essentially, I'm changing my<br>
position from "We should include support for hierarchical namespaces" to<br>
"We should make sure that we could easily add support for hierarchical<br>
namespaces in the future".<br>
<br>
## Pervasive modules<br>
<br>
I think that the simplest solution to Yaron's need for "automatically<br>
opened" modules is to say that:<br>
<br>
    open namespace Foo<br>
<br>
will open the namespace Foo and then, if it exists, open the module<br>
Foo#Pervasives.<br>
<br>
Members of Foo#Pervasives would not be accessible directly from Foo<br>
(i.e. Foo#id != Foo#Pervasives.id).<br>
<br>
I think this has the following benefits:<br>
<br>
- This is basically a syntactic solution: we don't need to "dirty" the<br>
  semantics or specification of modules with the issue of automatically<br>
  opening modules.<br>
<br>
- Only one Pervasives is opened, so conflicts between separate<br>
  specifications of a namespace should be obvious immediately. Its<br>
  relience on a specific name also makes the potential for conflicts<br>
  obvious to users.<br>
<br>
- It is clearly a bit of a fudge, which will discourage its excessive<br>
  use, and prevent any percevied overlap bewteen namespaces and<br>
  modules. This also makes it seem less "offensive" that it slightly<br>
  breaks the idea that "let open namespace Foo in id" should be<br>
  basically the same as "Foo#id"<br>
<br>
- It fits in with the standard library's use of Pervasives. You could<br>
  consider current behaviour as simply opening the "Std" namespace<br>
  before every program.<br>
<br>
I think that simple solution is better than trying to find a generalised<br>
sematics for "automatic opens" in namespaces. As Gabriel's e-mail shows,<br>
these semantics are non-trivial. I think that it is better to solve a<br>
specific problem with a specific solution, rather than creating a<br>
generalised solution for its own sake.<br>
<br>
Regards,<br>
<br>
Leo<br>
_______________________________________________<br>
Platform mailing list<br>
<a href="mailto:Platform@lists.ocaml.org">Platform@lists.ocaml.org</a><br>
<a href="http://lists.ocaml.org/listinfo/platform" target="_blank">http://lists.ocaml.org/listinfo/platform</a><br>
</blockquote></div>