From: Jean-Baptiste Rouquier <jean-baptiste.rouquier@ens-lyon.org>
To: "caml-list@inria.fr" <caml-list@inria.fr>
Subject: [Caml-list] module / directory tree OR #include for camp4
Date: Mon, 26 Apr 2004 15:10:27 +0200 [thread overview]
Message-ID: <408D0A43.50802@ens-lyon.org> (raw)
Hello list !
Is there an #include like directive in camlp4 ? I tried #use "foo.ml",
it works alone, but not in the following case:
module Bar = struct
#use "foo.ml"
end
.
Here is my problem:
I'd like to structure my code in modules, say I have the modules Plot,
Topo and Main. Both modules Plot and Topo contain (among others) a
submodule named Line, so in the module Main I have calls to
Plot.Line.foo and to Topo.Line.bar. No problems.
But now, since the modules are quite big, I'd like to put them into
separate directories: sources/topo/<lots of files> and
sources/plot/<lots of files>. And I'd like to have the submodules Line
in their own files : sources/topo/line.ml and sources/plot/line.ml.
Everything compiles fine with the -pack option. But I don't know how to
generate documentation, since I have no plot.ml or topo.ml files. And
passing -I plot -I topo makes ocamldoc complain about several
definitions of module Line.
I tried creating a file sources/plot.ml with
module Line = struct include Line_aux end
and passing only '-I plot' when compiling (without linking) plot.ml. It
works, but I can't generate documentation.
I then thought of (file plot.ml)
module Line = struct
#use "plot/line.ml"
end
but it's not accepted by camlp4.
So my question is: Is there a canonical way to have submodules with the
same name (in different modules) in separate files, allowing to generate
documentation and use ocamlopt ? It would be even better if the
directory tree would be reflected in the module tree.
I know I could rename my modules Plot.Line_plot and Topo.Line_topo, but
it's not satisfying.
Thanks,
Jean-Baptiste.
-------------------
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 reply other threads:[~2004-04-26 13:09 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-04-26 13:10 Jean-Baptiste Rouquier [this message]
2004-04-27 18:11 ` Richard Jones
2004-04-27 19:13 ` David Brown
2004-04-27 21:53 ` Jean-Baptiste Rouquier
2004-04-30 0:13 ` Sylvain LE GALL
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=408D0A43.50802@ens-lyon.org \
--to=jean-baptiste.rouquier@ens-lyon.org \
--cc=caml-list@inria.fr \
/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