From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (from majordomo@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id PAA18825; Mon, 26 Apr 2004 15:09:25 +0200 (MET DST) X-Authentication-Warning: pauillac.inria.fr: majordomo set sender to owner-caml-list@pauillac.inria.fr using -f Received: from concorde.inria.fr (concorde.inria.fr [192.93.2.39]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id PAA18815 for ; Mon, 26 Apr 2004 15:09:24 +0200 (MET DST) Received: from oceanite.ens-lyon.fr (oceanite.ens-lyon.fr [140.77.1.22]) by concorde.inria.fr (8.12.10/8.12.10) with ESMTP id i3QD9NYM012731 for ; Mon, 26 Apr 2004 15:09:23 +0200 Received: from localhost (oceanite.ens-lyon.fr [127.0.0.1]) by oceanite.ens-lyon.fr (Postfix) with ESMTP id 36C353203B1 for ; Mon, 26 Apr 2004 15:09:09 +0200 (CEST) Received: from oceanite.ens-lyon.fr ([127.0.0.1]) by localhost (oceanite [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 05188-04 for ; Mon, 26 Apr 2004 15:09:09 +0200 (CEST) Received: from ens-lyon.org (unknown [140.77.128.163]) by oceanite.ens-lyon.fr (Postfix) with ESMTP id 06A6F3203A7 for ; Mon, 26 Apr 2004 15:09:09 +0200 (CEST) Message-ID: <408D0A43.50802@ens-lyon.org> Date: Mon, 26 Apr 2004 15:10:27 +0200 From: Jean-Baptiste Rouquier User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.5) Gecko/20031107 Debian/1.5-3 X-Accept-Language: en MIME-Version: 1.0 To: "caml-list@inria.fr" Subject: [Caml-list] module / directory tree OR #include for camp4 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: by amavisd-new-20030616-p7 (Debian) at ens-lyon.fr X-Miltered: at = by Joe's j-chkmail ("http://j-chkmail.ensmp.fr")! X-Loop: caml-list@inria.fr X-Spam: no; 0.00; ens-lyon:01 camlp:01 foo:01 struct:01 foo:01 submodule:01 submodules:01 compiles:01 -pack:01 passing:01 ocamldoc:01 struct:01 passing:01 '-i:01 camlp:01 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk 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/ and sources/plot/. 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