From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (from weis@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id SAA13632 for caml-red; Mon, 8 Jan 2001 18:49:48 +0100 (MET) 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 PAA31175 for ; Mon, 8 Jan 2001 15:01:37 +0100 (MET) Received: from ext.lri.fr (ext.lri.fr [129.175.15.4]) by concorde.inria.fr (8.11.1/8.10.0) with ESMTP id f08E1aD02206; Mon, 8 Jan 2001 15:01:36 +0100 (MET) Received: from pc87.lri.fr (IDENT:root@pc87 [129.175.8.106]) by ext.lri.fr (8.11.1/jtpda-5.3.2) with ESMTP id f08E1Uu07854 ; Mon, 8 Jan 2001 15:01:31 +0100 (MET) Received: from lri.fr (IDENT:jcourant@localhost.localdomain [127.0.0.1]) by pc87.lri.fr (8.9.3/jtpda-5.3.2) with ESMTP id PAA21544 ; Mon, 8 Jan 2001 15:01:26 +0100 Message-ID: <3A59C835.18B126AD@lri.fr> Date: Mon, 08 Jan 2001 15:01:25 +0100 From: Judicael Courant X-Mailer: Mozilla 4.72 [fr] (X11; U; Linux 2.2.14-5.0 i686) X-Accept-Language: en MIME-Version: 1.0 To: Xavier Leroy CC: Charles Martin , caml-list@inria.fr Subject: Re: Module hierarchies References: <5.0.0.25.0.20010106112842.00a3eeb0@chasm.org> <20010108112417.D13356@pauillac.inria.fr> Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Sender: weis@pauillac.inria.fr Xavier Leroy a écrit : > > I still have no idea how hard it is to implement Judicaël's scheme, > though. > What about the following idea (close to Vitaly Lugovsky's suggestion): - the name of a compilation_unit would be a string list instead of a string. - ocamlnewmagiccommand -o lib.cma a.cmo b.cmo c.cmo would rename the name of "A", "B" and "C" to [ "Lib" ; "A" ], [ "Lib" ; "B" ] and [ "Lib" ; "C"], would compile a small lib.ml with contents "module A = A;; module B = B;; module C=C;;" into lib.cmo and would replace references of a.cmo, b.cmo, c.cmo and lib.cmo to A, B, C by references to ["Lib"; "A" ], [ "Lib"; "B" ], [ "Lib"; "C" ]. Then, it would just pack together these modules into one single library. I am not really familiar with ocamlc source code but from what I can read in bytecode/emitcode.mli, I guess implementing the two needed operations (renaming a compilation unit and renaming some references of a compilation unit to other compilation units) would be quite easy. Did I miss anything ? Judicaël. -- Judicael.Courant@lri.fr, http://www.lri.fr/~jcourant/ (+33) (0)1 69 15 64 85 "Montre moi des morceaux de ton monde, et je te montrerai le mien" Tim, matricule #929, condamné à mort. http://rozenn.picard.free.fr/tim.html