[ocaml-platform] Followup to Leo's proposal

Daniel Bünzli daniel.buenzli at erratique.ch
Tue Mar 12 19:01:33 GMT 2013

Le mardi, 12 mars 2013 à 18:37, Gabriel Scherer a écrit :
> I think if auto-open is a hard requirement there is no good way around
> moving to an ordered model as Didier explained would be needed.
> In this semantics, a namespace an ordered mapping from names to
> subnamespaces or compilation units, with either (you can choose two
> different, equivalent representations)
> - some of them marked "flat-access" (the star in the graphical representation)
> - an additional stack of unnamed subnamespaces and modules to auto-open

I don't really like the concept of auto-open which looks really ad-hoc to me. Did anybody investigate the idea of being:  

1) able to attach values and types to namespaces instead of just modules  
2) being able to open a namespace, bringing in scope the names it has attached to.  

Would it maybe help clear up some semantics issues ? For me 1) + 2) better matches the already existing concept of opening a module: this may bring new value, type, module names in your scope, but there's nothing that is "auto-opened".
And (aside from the problem of how this would be concretely expressed) would that actually satisfy the proponents of "auto-open"s. Or is there something else I miss in the concept of "auto-open" ?  


More information about the Platform mailing list