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

Alain Frisch alain.frisch at lexifi.com
Fri Feb 22 18:21:11 GMT 2013


On 2/22/2013 7:12 PM, Leo White wrote:
> For namespaces:
>
> - Whenever ocamldep encounters a line "in A#B" within c.mli then it creates
>    a dependency "A#B#C: c.mli".
>
> - Whenever it finds a use A#B#C in a file e.mli it creates a dependency
>    "e.mli: A#B#C".
>
> - Build systems are modified to include support for phony namespace
> targets.

Are you suggesting that support for namespace would require to change 
make and omake, or just their "OCaml-specific" rules (defined in user 
land, not in the tool itself)?

I'm not sure that what you describe above correspond to phony targets as 
currently understood by make and omake (I might be wrong).

Could you also describe how this would be affected if we allow opening 
namespaces?  It seems to me that the safe thing to do would be quite 
ugly (a reference to a module "A" would create many candidate 
dependencies for all opened namespaces).  Moreover, would you support 
opening namespaces within namespaces (i.e. is "open namespace A;; open 
namespace B" a valid way to open the namespace A/B?)

Alain


More information about the Platform mailing list