From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on yquem.inria.fr X-Spam-Level: ** X-Spam-Status: No, score=2.0 required=5.0 tests=DNS_FROM_SECURITYSAGE, SUBJECT_EXCESS_QP autolearn=disabled version=3.1.3 X-Original-To: caml-list@yquem.inria.fr Delivered-To: caml-list@yquem.inria.fr Received: from mail1-relais-roc.national.inria.fr (mail1-relais-roc.national.inria.fr [192.134.164.82]) by yquem.inria.fr (Postfix) with ESMTP id 0F93BBBAF for ; Tue, 18 Nov 2008 23:46:52 +0100 (CET) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: ArMBAMPUIknUnw4UlGdsb2JhbACCPJEcAQEBAQkLCAkRA759gnk X-IronPort-AV: E=Sophos;i="4.33,627,1220220000"; d="scan'208";a="20104791" Received: from pih-relay08.plus.net ([212.159.14.20]) by mail1-smtp-roc.national.inria.fr with ESMTP/TLS/AES256-SHA; 18 Nov 2008 23:46:51 +0100 Received: from [87.115.4.231] (helo=leper.local) by pih-relay08.plus.net with esmtp (Exim) id 1L2ZLP-0006wB-Hk for caml-list@yquem.inria.fr; Tue, 18 Nov 2008 22:46:51 +0000 From: Jon Harrop Organization: Flying Frog Consultancy Ltd. To: caml-list@yquem.inria.fr Subject: Re: [Caml-list] Wanted: your feedback on the hierarchy of =?iso-8859-1?q?OCaml=09Batteries?= Included Date: Tue, 18 Nov 2008 23:49:17 +0000 User-Agent: KMail/1.9.9 References: <1227002178.6170.25.camel@Blefuscu> <200811181817.23216.jon@ffconsultancy.com> <49233CA5.6080100@frisch.fr> In-Reply-To: <49233CA5.6080100@frisch.fr> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200811182349.17597.jon@ffconsultancy.com> X-Plusnet-Relay: 70b35f7bc9bbce026b1ab3359c3fd4d2 X-Spam: no; 0.00; ocaml:01 frisch:01 struct:01 struct:01 camlp:01 idioms:01 functor:01 separators:01 flatten:01 frog:98 sml:01 wrote:01 extensible:01 caml-list:01 alain:01 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