[ocaml-platform] Followup to Leo's proposal

Xavier Clerc xavier.clerc at inria.fr
Thu Mar 14 10:14:40 GMT 2013


----- Mail original -----

(...)

> > What about:
> >
> >  open namespace M1
> >  open namespace M2
> >  Bar.use
> >
> > ?
> >
> > Even with the "shallow" semantics, "ocamldep -modules" cannot know
> > if there is (or will be) a namespace M2.  So do we
> > get "M1#Bar", "M2#Bar", "M1#M2#Bar" and "Bar" as possible
> > dependencies?   The size of the output grows exponentially in
> > the number of "open namespace"!

Just for the record, Java has hierarchical namespace, but opening
one package does not give accesses to its sub-packages.

However, I acknowledge that having "open" for both modules and
namespaces with such a difference would be quite a problem.
Maybe we could have "open" for modules and "import" for namespaces
for example?

With such a semantics, the number of possible dependencies
is kept linear in the number of "import" directives.


Xavier


More information about the Platform mailing list