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] Alternative proposal: COAN
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2003-02-27 (15:41)
From: John Carr <jfc@M...>
Subject: [Caml-list] hierarchical modules

> The '-pack' mechanism was introduced in 3.06 to support separate
> compilation of the submodules.  Since it is a recent extension, it's
> not yet stable enough to be used widely, but I expect this to change
> with time.

I meant to send this a long time ago, but I forgot.  These are three
reasons, from least to most important, why I think the -pack feature
implemented in ocaml 3.06 is not sufficient for hierarchical modules.

1. Compiled-in module and file names used for backtrace and assert are
not fully qualified when using -pack.  I have seen several ambiguous
backtraces when I used the same module name in two container modules
(i.e. used the same file name in two directories).

2. A module can not be -packed into a container module of the same name.

3. I want a separate interface file for the container module.  There
are two reasons for this:

(a) I want to have global, package, and module scope for names, including
making a type used by multiple modules within a directory opaque to other
code outside the directory.

(b) I don't want to recompile all my other code because a change to
the implementation of my module caused the container .cmi file to change.

I prefer specifying the container module name on the command line or
adding a "package" declaration to the source file as in Java.

	John Carr
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