Version française
Home     About     Download     Resources     Contact us    

This site is updated infrequently. For up-to-date information, please visit the new OCaml website at

Browse thread
[Caml-list] Cross Modules
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Warp <warplayer@f...>
Subject: [Caml-list] Cross Modules
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 Archives:
Bug reports: FAQ:
Beginner's list: