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-27 (19:50)
From: Chris Hecker <checker@d...>
Subject: Re: [Caml-list] camlimages vs. labltk

>Do you see what the problems are with the module system?

Okay, let me restate your point and you can tell me if I got it.  You're 
saying the module system is bad for namespacing because it has the semantic 
of initializing all of its values without necessarily being referenced by 
the main program.  In other words, if I link in Foo, then Foo.myval has to 
be initialized or else the semantics of the module system are broken (side 
effects won't take place, etc.).  So, you can't use pack because pack 
implies a single large module, and the semantics above say you have to link 
and run all of the submodules in order for it to be a "real ocaml 
module".  And, there's no semantic for having some submodules not linked 
in, nor any way to specify that.  Right?

By contrast, cma libraries are different, in that the modules in them 
aren't linked unless they're referenced, right?  So, there is some 
precedent and process for demand based linking (as opposed to always 
linking everything on the link line).

Assuming we're on the same page about all of the above, do you think the 
syntax of the module system should or should not be overloaded for namespaces?

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?

I agree that if the module semantics make it so that pack must link all 
submodules and run all initialization then it's too heavyweight and it 
either needs to be changed or there needs to be a new system.


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