Am Freitag, den 02.01.2015, 15:03 +0100 schrieb Remco Vermeulen: > So my question is. is BAR in the above example correctly identified as a compilation unit by ocamldep? The syntax doesn't allow an unambiguous identification, so ocamldep needs to take into account that BAR is a compilation unit. It doesn't follow "open" when doing this, and I guess this is the point that confuses you. The problem is that "ocamldep -modules" by definition can only analyze a single module. The output is imprecise, however, and possible inter-module effects are not taken into account (among other things). A precise output would list BAR with the exception that it might be shadowed by Foo. But imagine now we had the information with this degree of detail. As omake wants to figure out the dependencies it would have to solve a puzzle. In your case it is easily to solve, but in practice there are often several "open" directives, and in this case you don't even know whether "open Foo" opens a compilation unit. I am not sure whether a well-performing algorithm even exists (did anybody tackle this problem?). The workaround is to use naming schemes that allow you to clearly distinguish between local modules and compilation unit (e.g. all your local modules have 1-3 characters, and all compilation units have longer names). Gerd -- ------------------------------------------------------------ Gerd Stolpmann, Darmstadt, Germany gerd@gerd-stolpmann.de My OCaml site: http://www.camlcity.org Contact details: http://www.camlcity.org/contact.html Company homepage: http://www.gerd-stolpmann.de ------------------------------------------------------------