Browse thread
[Caml-list] Circular module dependencies
[
Home
]
[ Index:
by date
|
by threads
]
[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
| Date: | -- (:) |
| From: | Jacques GARRIGUE <garrigue@k...> |
| Subject: | Re: [Caml-list] Circular module dependencies |
From: Tony Edgin <edgin@slingshot.co.nz> > Recently, there was a thread which talked about how difficult module > dependencies were to resolve for linking in Ocaml. I'm guessing this is > because of cycles in the dependency graph. > > My thought is that maybe Ocaml shouldn't allow this to happen. Wouldn't > cyclical module dependencies be a symptom of bad design? Bingo. Ocaml does not allow it. It just happens that you can cheat the compiler into accepting two different acyclic dependency graphs: one for the types (compilation order of the .mli's) and one for the values (compilation order of the .ml's). This was never intended, but there is no specific reason to go to great length to defeat that trick, as it is still safe. At least that's my take on the question. > If a cyclic dependency occurs I can think of two ways of removing. Indeed, this is the reasonable approach. --------------------------------------------------------------------------- Jacques Garrigue Kyoto University garrigue at kurims.kyoto-u.ac.jp <A HREF=http://wwwfun.kurims.kyoto-u.ac.jp/~garrigue/>JG</A> ------------------- 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