From: Xavier Leroy <xavier.leroy@inria.fr>
To: John Carr <jfc@MIT.EDU>
Cc: caml-list@inria.fr
Subject: [Caml-list] Re: hierarchical modules
Date: Sat, 1 Mar 2003 19:09:14 +0100 [thread overview]
Message-ID: <20030301190914.A14739@pauillac.inria.fr> (raw)
In-Reply-To: <200302271539.KAA05673@contents-vnder-pressvre.mit.edu>; from jfc@MIT.EDU on Thu, Feb 27, 2003 at 10:39:18AM -0500
> 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. [...]
I agree with point 3. In addition to the reasons you gave, the .mli
for the container module would be the best place to put its
documentation (for the final user). One way to implement point 3
would be to do in ocamlc -pack exactly what ocamlc -c does: if there
is no .mli file, synthesize a .cmi interface; otherwise, check
compatibility with the .cmi interface derived from the .mli file.
I'll see if this can be implemented.
Point 2 doesn't seem too serious to me, since having the same name for
a module and one of its submodules is confusing to the final users
(e.g. Module.Module.value).
> I prefer specifying the container module name on the command line or
> adding a "package" declaration to the source file as in Java.
Well, that would be necessary to address your point 1, and would also
remove the dependency on the GNU binutils tools (for ocamlopt -pack).
The one drawback of this approach is that compiled files thus
"pre-packed" could not be linked or loaded in the toplevel, only the
packed container would be; that might make testing a bit harder.
- Xavier Leroy
-------------------
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
next prev parent reply other threads:[~2003-03-01 18:09 UTC|newest]
Thread overview: 53+ messages / expand[flat|nested] mbox.gz Atom feed top
2003-02-24 16:54 [Caml-list] Alternative proposal: COAN Benjamin C. Pierce
2003-02-24 18:24 ` Chris Hecker
2003-02-24 20:17 ` Francois Rouaix
2003-02-24 20:28 ` Basile STARYNKEVITCH
2003-02-24 21:03 ` Brian Hurt
2003-02-24 21:10 ` Brian Hurt
2003-02-24 21:22 ` Benjamin C. Pierce
2003-02-25 10:54 ` roberto
2003-02-25 13:20 ` Sven Luther
2003-02-25 13:36 ` roberto
2003-02-25 16:07 ` Sven Luther
2003-02-25 14:17 ` MikhailFedotov
2003-02-25 17:15 ` Eric C. Cooper
2003-02-25 21:48 ` Michal Moskal
2003-02-25 22:14 ` Lauri Alanko
2003-02-26 14:06 ` Sven Luther
2003-02-27 8:05 ` Blair Zajac
2003-02-27 8:29 ` Xavier Leroy
2003-02-23 16:51 ` Chet Murthy
2003-02-27 15:39 ` [Caml-list] hierarchical modules John Carr
2003-03-01 18:09 ` Xavier Leroy [this message]
2003-03-01 18:18 ` [Caml-list] " Michal Moskal
2003-03-02 15:58 ` Xavier Leroy
2003-02-25 22:59 ` [Caml-list] Alternative proposal: COAN Sven Luther
2003-02-26 9:47 ` Michal Moskal
2003-02-26 10:11 ` Sven Luther
2003-02-26 10:26 ` Michal Moskal
2003-02-26 11:53 ` Sven Luther
2003-02-26 10:35 ` Olivier Andrieu
2003-02-26 12:03 ` Sven Luther
2003-02-27 3:19 ` Nicolas Cannasse
2003-02-23 15:05 ` Chet Murthy
2003-02-27 4:54 ` Nicolas Cannasse
2003-02-23 16:13 ` Chet Murthy
2003-02-27 9:20 ` Sven Luther
2003-02-27 10:39 ` Damien Doligez
2003-02-28 9:20 ` Jacques Garrigue
2003-02-28 10:53 ` Sven Luther
2003-02-28 12:28 ` Jean-Christophe Filliatre
2003-02-28 13:08 ` Markus Mottl
2003-02-28 13:27 ` Sven Luther
2003-02-28 14:05 ` Jean-Christophe Filliatre
2003-02-28 14:43 ` Sven Luther
2003-02-28 15:58 ` Benjamin C. Pierce
2003-03-01 18:03 ` Michal Moskal
2003-03-01 8:14 ` Blair Zajac
2003-03-02 18:21 ` Xavier Leroy
2003-03-02 20:09 ` Sven Luther
2003-03-02 21:38 ` Doug Bagley
2003-03-03 2:39 ` Nicolas Cannasse
2003-03-03 9:07 ` Sven Luther
2003-03-03 9:24 ` Nicolas Cannasse
2003-03-03 9:37 ` Sven Luther
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20030301190914.A14739@pauillac.inria.fr \
--to=xavier.leroy@inria.fr \
--cc=caml-list@inria.fr \
--cc=jfc@MIT.EDU \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox