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 MAA04174; Tue, 8 Apr 2003 12:33:41 +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 MAA04311 for ; Tue, 8 Apr 2003 12:33:40 +0200 (MET DST) Received: from isis.lip6.fr (isis.lip6.fr [132.227.60.2]) by concorde.inria.fr (8.11.1/8.11.1) with ESMTP id h38AXdX02412 for ; Tue, 8 Apr 2003 12:33:39 +0200 (MET DST) Received: from spi.lip6.fr (IDENT:root@spi.lip6.fr [132.227.83.55]) by isis.lip6.fr (8.12.9/jtpda-5.4+victor) with ESMTP id h38AXbqp032431 ; Tue, 8 Apr 2003 12:33:38 +0200 X-pt: isis.lip6.fr Received: from inria.fr ([132.227.83.193]) by spi.lip6.fr (8.8.7/jtpda-5.2) with ESMTP id MAA01225 ; Tue, 8 Apr 2003 12:33:36 +0200 Date: Tue, 8 Apr 2003 12:33:57 +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) Cc: caml-list@inria.fr To: Chris Hecker From: Damien Doligez In-Reply-To: <4.3.2.7.2.20030401114643.01cdd9d8@localhost> Message-Id: <9AB776C0-69AD-11D7-B7DE-0003930FCE12@inria.fr> Content-Transfer-Encoding: 7bit X-Mailer: Apple Mail (2.551) X-Scanned-By: isis.lip6.fr X-Spam: no; 0.00; damien:01 caml-list:01 camlimages:01 labltk:01 hecker:01 -pack:01 renaming:01 submodules:01 chris:01 cmo:01 semantics:01 bytecode:01 doligez:01 native:02 linking:02 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk On Tuesday, April 1, 2003, at 09:51 PM, Chris Hecker wrote: > In other words, if I -pack B and A, and B uses a module A, then B's > imports should be resolved to the A that it got packed with. I think we're in violent agreement here. Then my point simply becomes that we need to rename B's imports to get this result. Making this renaming implicit or explicit then becomes a matter of design. > In fact, this might already happen with pack, since you can -pack > modules that refer to other modules, and since they're now in a > super-module, the semantics are that they should still refer to the > submodules at the same scope. So, this should already work with > -pack, no? Yes, but that's because -pack actually performs a link of the packed modules. It renames B's imports by resolving them. > If so, then the cmo/cma partial linking thing is the only thing > wrong with -pack from both a package and namespace manager > perspective. If you want -pack to produce a cma (i.e. a collection of independent modules), then you have to rename A both as an export and as B's import. Actually, that's not quite true. In bytecode, you can link several modules with the same name in a program. If you take care to link them in the right order, you can make sure that other modules' imports are resolved by the right versions. But in native code this trick doesn't work. -- 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