caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Peng Zang <peng.zang@gmail.com>
To: caml-list@yquem.inria.fr
Cc: Dawid Toton <dawid.toton@uj.edu.pl>
Subject: Re: [Caml-list] Toplevel - loading dependencies
Date: Fri, 9 Jan 2009 12:53:16 -0500	[thread overview]
Message-ID: <200901091253.19895.peng.zang@gmail.com> (raw)
In-Reply-To: <49675DE7.5030000@uj.edu.pl>

-----BEGIN PGP SIGNED MESSAGE-----
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.

Peng

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:
> http://yquem.inria.fr/cgi-bin/mailman/listinfo/caml-list
> Archives: http://caml.inria.fr
> Beginner's list: http://groups.yahoo.com/group/ocaml_beginners
> Bug reports: http://caml.inria.fr/bin/caml-bugs
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.7 (GNU/Linux)

iD8DBQFJZ48PfIRcEFL/JewRAvcBAJ93neP1/3O6GCqImp4PP/UPTd/iCACfeyTn
zFNLx2UjBo6pkgb9z3a0NPk=
=6+qX
-----END PGP SIGNATURE-----


      parent reply	other threads:[~2009-01-09 17:53 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-01-09 14:23 Dawid Toton
2009-01-09 14:33 ` [Caml-list] " Matthieu Dubuget
2009-01-09 17:14 ` Florent Monnier
2009-01-09 18:13   ` Dawid Toton
2009-01-09 17:53 ` Peng Zang [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=200901091253.19895.peng.zang@gmail.com \
    --to=peng.zang@gmail.com \
    --cc=caml-list@yquem.inria.fr \
    --cc=dawid.toton@uj.edu.pl \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).