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

Daniel Bünzli daniel.buenzli at erratique.ch
Thu Feb 28 15:59:47 GMT 2013


Le jeudi, 28 février 2013 à 16:12, Didier Remy a écrit :
> Defining the semantics means:
>  
> - a mathematical model of namespaces: are they flat mappings of strings
> to module objects or trees of module objects? or are they also
> mapping "whatever" to values? Do they carry additional information such
> as auto-open tags?

I had a cursory look at Maxence link on F# and Java's packages [1]. It seems both allow only types and modules to be part of a namespace, I wonder if there's a reason to that.

If opening a namespace may also open a module seems to be equivalent to be able to attach values to namespacea. That is if opening the namespace `Ns` defines the value `f` in my scope, for me, I should also be able to refer to this `f` via `Ns.f` otherwise the elements of a namespace seems to change depending on whether it is opened or not.  

Daniel

[1] http://docs.oracle.com/javase/specs/jls/se7/html/jls-7.html
  



More information about the Platform mailing list