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 XAA30300; Sun, 22 Sep 2002 23:28:45 +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 XAA30290 for ; Sun, 22 Sep 2002 23:28:44 +0200 (MET DST) Received: from moutng.kundenserver.de (moutng.kundenserver.de [212.227.126.187]) by concorde.inria.fr (8.11.1/8.11.1) with ESMTP id g8MLSh521526 for ; Sun, 22 Sep 2002 23:28:43 +0200 (MET DST) Received: from [212.227.126.160] (helo=mrelayng0.kundenserver.de) by moutng.kundenserver.de with esmtp (Exim 3.35 #1) id 17tEHT-0004j3-00; Sun, 22 Sep 2002 23:28:43 +0200 Received: from [80.129.98.41] (helo=gate.gerd-stolpmann.de) by mrelayng0.kundenserver.de with asmtp (Exim 3.35 #1) id 17tEHS-0007JY-00; Sun, 22 Sep 2002 23:28:42 +0200 Received: from ice.gerd-stolpmann.de (ice.gerd-stolpmann.de [192.168.0.13]) by gate.gerd-stolpmann.de (Postfix) with ESMTP id 57FA4CCDD; Sun, 8 Sep 2002 20:04:42 +0200 (CEST) Received: from ice (localhost [127.0.0.1]) by ice.gerd-stolpmann.de (Postfix) with ESMTP id 9C5F7B0B8; Sun, 22 Sep 2002 23:29:20 +0200 (CEST) Date: Sun, 22 Sep 2002 23:29:20 +0200 From: Gerd Stolpmann To: Alessandro Baretta Cc: Gerd Stolpmann , Ocaml Subject: Re: [Caml-list] Meta module in findlib and the need for namespaces Message-ID: <20020922212920.GG914@ice.gerd-stolpmann.de> References: <3D87406D.9010406@baretta.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <3D87406D.9010406@baretta.com>; from alex@baretta.com on Die, Sep 17, 2002 at 16:47:09 +0200 X-Mailer: Balsa 1.4.0 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk Hi, Am 2002.09.17 16:47 schrieb(en) Alessandro Baretta: > There seems to be an incompatibility between dynlink.cma and > findlib. The following text shows a sample toplevel session > where you can see how linking to "dynlink.cma" is rendered > impossible by the presence of the findlib module. > > Objective Caml version 3.06 > > # #use "topfind";; > Findlib has been successfully loaded. Additional directives: > #require "package";; to load a package > #list;; to list the available packages > #camlp4o;; to load camlp4 (standard syntax) > #camlp4r;; to load camlp4 (revised syntax) > Topfind.reset();; to force that packages will be > reloaded > > - : unit = () > # #require "afo";; > Loading /usr/lib/ocaml/site-lib/pcre/pcre.cma > Loading /usr/lib/ocaml/unix.cma > Loading /usr/lib/ocaml/site-lib/netstring/netstring.cma > Loading /usr/lib/ocaml/site-lib/netstring/netmappings_iso.cmo > Loading /usr/lib/ocaml/site-lib/netstring/netmappings_other.cmo > Loading /usr/lib/ocaml/site-lib/netstring/netstring_top.cmo > Loading /usr/lib/ocaml/site-lib/pxp-engine/pxp_engine.cma > Loading /usr/lib/ocaml/site-lib/pxp-engine/pxp_top.cmo > Loading > /usr/lib/ocaml/site-lib/pxp-lex-iso88591/pxp_lex_iso88591.cma > Loading > /usr/lib/ocaml/site-lib/pxp-lex-iso88591/pxp_lex_link_iso88591.cmo > Loading /usr/lib/ocaml/site-lib/pxp-lex-utf8/pxp_lex_utf8.cma > Loading > /usr/lib/ocaml/site-lib/pxp-lex-utf8/pxp_lex_link_utf8.cmo > *Loading /usr/lib/ocaml/dynlink.cma* > Files /usr/lib/ocaml/dynlink.cma > and /usr/lib/ocaml/site-lib/findlib/findlib.cma > make inconsistent assumptions over interface Meta > > This seems to imply that a Meta module is already defined in > dynlink.cma, and that such module is different from that > referenced by findlib. I have no evidence to prove this > point though, for I have not found in the Ocaml sources > where a Meta module is defined. There is a module "Meta" in the byte compiler, and it is member of dynlink.cma. So your observation is right. > *** > > This incompatibility between findlib and dynlink is the > first example I have encountered of a nameclash bug in Ocaml > software. Of course, Gerd could easily solve the problem by > renaming his Meta to Findlib_meta, or something like that, > but it would be a lot easier to have a namespace construct > to allow Gerd to distinguish *his* Meta from the one in the > standard library. I think there are two problems: (1) The name clash as such (2) The fact that dynlink.cma contains a hidden module (no cmi is installed for it), making the name clash surprising and hard to debug. Note that dynlink.cma not only contains Meta, but also other modules with plain names: Misc, Config, Ident, Path, Types, i.e. names for which name clashes are much more likely than for cryptic names. Maybe problem (2) can be fixed by using "include" to link the needed compiler modules to Dynlink, i.e. something like module Meta = struct include Meta end so Meta would not occur in dynlink.cma anymore. Gerd ------------------------------------------------------------ Gerd Stolpmann * Viktoriastr. 45 * 64293 Darmstadt * Germany gerd@gerd-stolpmann.de http://www.gerd-stolpmann.de ------------------------------------------------------------ ------------------- 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