English version
Accueil     À propos     Téléchargement     Ressources     Contactez-nous    

Ce site est rarement mis à jour. Pour les informations les plus récentes, rendez-vous sur le nouveau site OCaml à l'adresse ocaml.org.

Browse thread
[Caml-list] camlimages vs. labltk
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2003-03-28 (15:00)
From: Sven Luther <luther@d...>
Subject: Re: [Caml-list] camlimages vs. labltk
On Fri, Mar 28, 2003 at 03:10:04PM +0100, Damien Doligez wrote:
> On Thursday, March 27, 2003, at 08:46 PM, Chris Hecker wrote:
> >It seems like there are a couple different options:
> >
> >1.  relax the semantics of module inclusion/initialization so that 
> >-pack can simultaneously provide the nested module syntax of 
> >Package.Foo but it doesn't have to link all of the submodules, like a 
> >cma
> >
> >2.  define a new namespace system and syntax (or reuse the module 
> >syntax, not sure what the issues are there)
> >
> >Are there any other options?  Did I get all of that right?
> How about a solution based on renaming ?  Let's say I have two modules
> from different programmers, both named "Mylib", and I want to use them
> in my program.  I cannot because the module system does not allow two
> different modules with the same name to coexist.  The obvious solution
> is a tool that renames one of the Mylib modules.  Then I can use both
> modules in one program.
> It becomes a little more complex when you consider that a module also
> imports other modules, referenced by their names.  For example, I can
> have (in addition to the two "Mylib" modules) another pair of modules,
> Extlib and Superlib, written by two other programmers, and I want to
> use them both in my program.  And Extlib uses one of the Mylib, Superlib
> uses the other one.  Now if I rename the second Mylib into Mylib2,
> I also have to tell Superlib to use Mylib2 instead of Mylib.
> So I need a tool to rename modules, both as exports and as imports,
> then I can use any module I want, without changing anything in the
> language, and without the need for a universal naming scheme.

Does this not sound as a ugly hack ? 

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 ?

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 ?


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