From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (from majordomo@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id TAA15532; Sat, 1 Mar 2003 19:09:17 +0100 (MET) X-Authentication-Warning: pauillac.inria.fr: majordomo set sender to owner-caml-list@pauillac.inria.fr using -f Received: from concorde.inria.fr (concorde.inria.fr [192.93.2.39]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id TAA15213 for ; Sat, 1 Mar 2003 19:09:16 +0100 (MET) Received: from pauillac.inria.fr (pauillac.inria.fr [128.93.11.35]) by concorde.inria.fr (8.11.1/8.11.1) with ESMTP id h21I9ET19594; Sat, 1 Mar 2003 19:09:14 +0100 (MET) Received: (from xleroy@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id TAA15464; Sat, 1 Mar 2003 19:09:14 +0100 (MET) Date: Sat, 1 Mar 2003 19:09:14 +0100 From: Xavier Leroy To: John Carr Cc: caml-list@inria.fr Subject: [Caml-list] Re: hierarchical modules Message-ID: <20030301190914.A14739@pauillac.inria.fr> References: <20030227092923.A496@pauillac.inria.fr> <200302271539.KAA05673@contents-vnder-pressvre.mit.edu> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Mailer: Mutt 1.0i In-Reply-To: <200302271539.KAA05673@contents-vnder-pressvre.mit.edu>; from jfc@MIT.EDU on Thu, Feb 27, 2003 at 10:39:18AM -0500 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk > I meant to send this a long time ago, but I forgot. These are three > reasons, from least to most important, why I think the -pack feature > implemented in ocaml 3.06 is not sufficient for hierarchical modules. > > 1. Compiled-in module and file names used for backtrace and assert are > not fully qualified when using -pack. I have seen several ambiguous > backtraces when I used the same module name in two container modules > (i.e. used the same file name in two directories). > > 2. A module can not be -packed into a container module of the same name. > > 3. I want a separate interface file for the container module. [...] I agree with point 3. In addition to the reasons you gave, the .mli for the container module would be the best place to put its documentation (for the final user). One way to implement point 3 would be to do in ocamlc -pack exactly what ocamlc -c does: if there is no .mli file, synthesize a .cmi interface; otherwise, check compatibility with the .cmi interface derived from the .mli file. I'll see if this can be implemented. Point 2 doesn't seem too serious to me, since having the same name for a module and one of its submodules is confusing to the final users (e.g. Module.Module.value). > I prefer specifying the container module name on the command line or > adding a "package" declaration to the source file as in Java. Well, that would be necessary to address your point 1, and would also remove the dependency on the GNU binutils tools (for ocamlopt -pack). The one drawback of this approach is that compiled files thus "pre-packed" could not be linked or loaded in the toplevel, only the packed container would be; that might make testing a bit harder. - Xavier Leroy ------------------- To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/ Beginner's list: http://groups.yahoo.com/group/ocaml_beginners