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 MAA23963; Sun, 30 Mar 2003 12:38:27 +0200 (MET DST) X-Authentication-Warning: pauillac.inria.fr: majordomo set sender to owner-caml-list@pauillac.inria.fr using -f Received: from nez-perce.inria.fr (nez-perce.inria.fr [192.93.2.78]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id MAA23809 for ; Sun, 30 Mar 2003 12:38:26 +0200 (MET DST) Received: from mwinf0203.wanadoo.fr (smtp5.wanadoo.fr [193.252.22.29]) by nez-perce.inria.fr (8.11.1/8.11.1) with ESMTP id h2UAcPX20062; Sun, 30 Mar 2003 12:38:26 +0200 (MET DST) Received: from iliana (AStrasbourg-206-1-29-82.abo.wanadoo.fr [81.50.248.82]) by mwinf0203.wanadoo.fr (Postfix) with ESMTP id 84DCB1000447; Sun, 30 Mar 2003 12:38:25 +0200 (CEST) Received: from luther by iliana with local (Exim 3.36 #1 (Debian)) id 18zaCm-0000YO-00; Sun, 30 Mar 2003 12:38:24 +0200 Date: Sun, 30 Mar 2003 12:38:24 +0200 To: Damien Doligez Cc: caml-list@inria.fr Subject: Re: [Caml-list] camlimages vs. labltk Message-ID: <20030330103824.GA1884@iliana> References: <20030328150028.GA9211@iliana> <45905683-6297-11D7-B6B4-0003930FCE12@inria.fr> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <45905683-6297-11D7-B6B4-0003930FCE12@inria.fr> User-Agent: Mutt/1.5.4i From: Sven Luther X-Spam: no; 0.00; sven:01 luther:01 dpt-info:01 u-strasbg:01 caml-list:01 camlimages:01 labltk:01 damien:01 -pack:01 propper:01 ocamltk:01 mlgtk:01 lablgtk:01 renaming:01 namespaces:01 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk On Sun, Mar 30, 2003 at 12:06:27PM +0200, Damien Doligez wrote: > On Friday, March 28, 2003, at 04:00 PM, Sven Luther wrote: > > >Does this not sound as a ugly hack ? > > Not to me... Ok, ... > >Would it not be easier to have something akin to -pack, but without its > >technical problems, and have each library pack its module into a > >namespace propper to this library ? > > How do you make sure that two different libraries never use the same > namespace ? And if I need to use two versions of the same library > in my program, how do you make sure that two versions of the same > library never use the same namespace ? Because you use something similar to the -pack option, each module inside a library would be qualified by the library name, so the only reason there could be a namespace conflict would be if two library used the same name (like if ocamltk and labltk both used Tk. or both mlgtk and lablgtk used Gtk.). If there is such a conflict, either the people doing the conflicting libraries discuss among themselves to solve the problem, either by one of them renaming their lib or both of them merging , or some higher authority (the ocaml team, a ocaml standardization comitee, a consensus reached on the ocaml mailing list) takes some decision on on which way the name should go. But still, i believe the name clash will pretty much be extremely rare, since they would occur only with the names of the library, not with the modules inside the libraries. Now, i understand that the -pack option is not technically ready for such a solution, if you consider that you have to link all modules of the library inside one huge .cmo, which has to be included whole anytime you use it. But i think that the above is the right solution to the naming problem, and if i remember well, some members of the ocaml team also seemed to be of that opinion last time this was discussed. > >If all library did this by default, at library build time, then there > >would be no need to rename the imports, since those imports would > >already have the modified (that is Library.Module) names ? > > You can't avoid renaming of imports unless you have a centralized > allocation of namespaces, and _that_ sounds like an ugly hack to me. I still don't understand what would have been renamed. Let's say a module A inside a library foo imports a module B from library bar. right now, we have the following : A imports B this causes problem if you want to link with another library which also has a module named B, or if you wish to name your own module B. now, if all modules of the library would be submodules of the library, then we would have : Foo.A imports Bar.B And now, another library zzz could have a module called B, which would be accesed as Zzz.B, and there would be no need to rename the imports. And even the personal module could either be plain B, or Personal.B or something. Sure, this displace the problam to library names instead of module names, but still, there are much less libraries around than there are modules. But then, maybe i am just being stupid and completely misunderstand the problem or something such, please enlighten me if this is the case. Friendly, Sven Luther ------------------- 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