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 NAA05524; Tue, 16 Apr 2002 13:22:09 +0200 (MET DST) X-Authentication-Warning: pauillac.inria.fr: majordomo set sender to owner-caml-list@pauillac.inria.fr using -f Received: from nez-perce.inria.fr (nez-perce.inria.fr [192.93.2.78]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id NAA06671 for ; Tue, 16 Apr 2002 13:22:08 +0200 (MET DST) Received: from relay-1m.club-internet.fr (relay-1m.club-internet.fr [194.158.104.40]) by nez-perce.inria.fr (8.11.1/8.11.1) with ESMTP id g3GBM7512671 for ; Tue, 16 Apr 2002 13:22:07 +0200 (MET DST) Received: from warp (lns04a-11-74.w.club-internet.fr [212.194.82.74]) by relay-1m.club-internet.fr (Postfix) with SMTP id B5F2616FC for ; Tue, 16 Apr 2002 13:22:05 +0200 (CEST) Message-ID: <001b01c1e538$d9e50a00$3900a8c0@warp> From: "Warp" To: "OCaml" Subject: [Caml-list] Cross Modules Date: Tue, 16 Apr 2002 13:21:27 +0200 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 5.50.4522.1200 X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4522.1200 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk Hi all I'm currently working on a ocaml program that will enable automatic compilation of ocaml projects. After making dependencies, I'm bumping in the following problem : If you got two modules A and B (both having ml+mli files) and if A calls a function of B and B calls a function of A then linking is impossible ( both ocamlc a.cmo b.cmo & ocamlc b.cmo a.cmo will fail ). But if for example A call a function of B which returns a type declared in A interface, then you have to call "ocamlc b.cmo a.cmo" and it'll works. Watching depencies generated by ocamldep, you can't really know in which case you are, because each time you have : a.cmo : b.cmi b.cmo : a.cmi And sometimes it can be "legal", and some other times not. I think it would be nice to have either ocamlc sort itself the cmo in the right order, and raise an error when theses cannot be link, or to have ocamldep telling us a little more (with some flag turn on) by adding the .cmo in the dependencies list when there is functions called. Since now I've written a quite simple algorithm that suppose you're using a "correct" design so both cases presented in this mail are rejected by automatic compilation. Nicolas Cannasse ------------------- 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