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 QAA30793; Tue, 1 Apr 2003 16:50:33 +0200 (MET DST) 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 QAA31909 for ; Tue, 1 Apr 2003 16:50:30 +0200 (MET DST) Received: from osiris.lip6.fr (osiris.lip6.fr [132.227.60.30]) by concorde.inria.fr (8.11.1/8.11.1) with ESMTP id h31EoT516439 for ; Tue, 1 Apr 2003 16:50:29 +0200 (MET DST) Received: from spi.lip6.fr (IDENT:root@spi.lip6.fr [132.227.83.55]) by osiris.lip6.fr (8.12.9/jtpda-5.4+victor) with ESMTP id h31EEYhq014216 for ; Tue, 1 Apr 2003 16:14:34 +0200 X-pt: osiris.lip6.fr Received: from inria.fr ([132.227.83.193]) by spi.lip6.fr (8.8.7/jtpda-5.2) with ESMTP id QAA30227 for ; Tue, 1 Apr 2003 16:14:33 +0200 Date: Tue, 1 Apr 2003 16:14:37 +0200 Subject: Re: [Caml-list] naming conflicts (was: camlimages vs. labltk) Content-Type: text/plain; charset=US-ASCII; format=flowed Mime-Version: 1.0 (Apple Message framework v551) From: Damien Doligez To: caml-list@inria.fr Content-Transfer-Encoding: 7bit In-Reply-To: <20030330103824.GA1884@iliana> Message-Id: <45804206-644C-11D7-9F5C-0003930FCE12@inria.fr> X-Mailer: Apple Mail (2.551) X-Scanned-By: osiris.lip6.fr X-Spam: no; 0.00; damien:01 caml-list:01 camlimages:01 labltk:01 sven:01 luther:01 stupid:01 namespaces:01 functors:01 chris:01 toplevel:01 doligez:01 enlighten:02 harder:02 linking:02 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk On Sunday, March 30, 2003, at 12:38 PM, Sven Luther wrote: > But then, maybe i am just being stupid and completely misunderstand the > problem or something such, please enlighten me if this is the case. Judging from your and Chris Hecker's mail, I think it's my fault for not explaining clearly what I have in mind. Let me try again. First of all, let me say that I am looking for a complete solution to the problem, not just a quick fix that works most of the time. From this point of view, there is no difference between modules and libraries: if there are naming conflicts between modules, there will also be conflicts between libraries. I'll give two examples of what I think the problem is. First example: I am building a program D, which uses libraries B and C. B uses another library, A. C also uses another library, A. But these are not the same A, so I have a name conflict. I don't want to change the source code of B or C (because I am not the author, and updating to a new version is much harder if I use modified libraries). So I need to rename the A used by B, and I need to tell B to use A under this new name. This is why I need to rename imports as well as exports. Second example (somewhat artificial): I am doing comparative benchmarks of two versions of library A. I'd like to wrap up everything into one O'Caml program, so I need to be able to link two different versions of A, and to call them under two different names. I don't need to rename imports for this one, but I think it illustrates the problem with namespaces: are you going to demand that every author of every library uses a different namespace for each version of the library ? Now that I think about it, I think both problems could be solved by changing toplevel modules into functors (instead of modules with free variables). Then we only need a small linking language to tell which export to use to satisfy each import. With suitable defaults (an import is satisfied by the export of the same name), this could be made compatible with the current system. -- Damien ------------------- 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