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
Toplevel - loading dependencies
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Peng Zang <peng.zang@g...>
Subject: Re: [Caml-list] Toplevel - loading dependencies
Hash: SHA1

Shouldn't ocamldep be able to solve this?  It can read a source file and 
figure out the dependencies.  So you could in theory generate a fake source 
file that is just "open A" and it should figure out the set of dependencies 
for module A.


On Friday 09 January 2009 09:23:35 am Dawid Toton wrote:
> Another problem with loading modules in the toplevel:
> I need to use the module A. So I write:
> #load "A.cmo"
> to get a messsage "Reference to undefined global B"
> So I prepend a line:
> #load B.cmo
>  and get another "undefined global". Then it repeats prohibitively many
> times.
> This is resolving dependencies by hand, one by one.
> The solution would be to have a special version of cmo that knows
> locations of all other cmo's it depends on.
> In special cases I could use cma archives, but this is only applicable
> when there is well defined and stable set of modules I need.
> But in practice the modules I use in ocaml scripts are constantly
> evolving. It leads to having multiple cma aggregates and maintaining
> their building description. Again, lots of work.
> If I put everything into one big cma, then I have to recompile it every
> small change. It takes so long time, that it would make no sense to use
> the interpreter at all.
> Could I ask ocamlbuild to produce proper loading preamble for my scripts?
> What is the right solution?
> Dawid
> _______________________________________________
> Caml-list mailing list. Subscription management:
> Archives:
> Beginner's list:
> Bug reports:
Version: GnuPG v2.0.7 (GNU/Linux)