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: | 2004-09-07 (06:13) |
From: | Erik de Castro Lopo <ocaml-erikd@m...> |
Subject: | Re: [Caml-list] Circular module dependencies |
On Mon, 6 Sep 2004 21:39:21 -0700 (PDT) brogoff <brogoff@speakeasy.net> wrote: > In a discussion on this topic a while back, Fergus Henderson cited as an > example the Mercury compiler, where removing the dependencies by making one > big file of the dependent parts would lead to a pretty large file. I thought > that was a decent argument in favor of allowing mutually recursive functions > to cross module boundaries. I was the initiator of a discussion much like this just recently. The good advice I got was to refactor and move the common stuff own the module hiearchy. So if you have two modules A and B which SEEM to need each other, create a new module C containing the required commong code and use the functionality of C in both A and B. I tried this for my situation and it not only worked like a charm, in hindsight it made a whole lot more sense this way. Erik -- +-----------------------------------------------------------+ Erik de Castro Lopo nospam@mega-nerd.com (Yes it's valid) +-----------------------------------------------------------+ "Perl : this is a blue collar language" - Angus Lees ------------------- 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