On Tuesday 18 November 2008 22:07:33 Alain Frisch wrote:
> and you want to extend M11, you need to write:
>
> module M' = struct
>    module M1 = struct
>      module M11 = struct include M.M1.M11 (* extension here *) end
>      module M12 = M.M1.M12
>      module M13 = M.M1.M13
>      ...
>    end
>    module M2 = M.M2
>    module M3 = M.M3
>    ...
> end

Ah, yes. Otherwise you get "Multiple definition of the module name ...".

Perhaps that could be solved with extensive Camlp4 hacking to rename the 
previous modules (even coming from an "include") to avoid the clash?

> Frankly, I don't think that having a nice and well-organized hierarchy
> of modules really matters. Things like having uniform interfaces,
> consistent idioms and compatible types across libraries seem much more
> important to me.

Indeed. I think the current system would withstand an order of magnitude more 
(popular) libraries. I'd also recommend the SML Basis library and F# for 
inspiration: they both contain some great designs.

> Anyway, if a hierarchy is desired, I fail to see any advantage of using "."
> instead of e.g. "_" (easily extensible + does not force you to link
> everything). 

That brings its own problems, of course. You no longer have a real hierarchy 
so you cannot do anything at a given depth in the hierarchy, e.g. apply 
mid-level module to a functor.

No doubt people will want both so we'll end up with an ad-hox mix of "." 
and "_" separators. In that case, I'd prefer to flatten every "_" (assuming 
names didn't clash).

-- 
Dr Jon Harrop, Flying Frog Consultancy Ltd.
http://www.ffconsultancy.com/?e

_______________________________________________
Caml-list mailing list. Subscription management:
http://yquem.inria.fr/cgi-bin/mailman/listinfo/caml-list
Archives: http://caml.inria.fr
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners
Bug reports: http://caml.inria.fr/bin/caml-bugs

Reply via email to