From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on yquem.inria.fr X-Spam-Level: * X-Spam-Status: No, score=1.7 required=5.0 tests=AWL,DNS_FROM_RFC_POST, SPF_NEUTRAL autolearn=disabled version=3.1.3 X-Original-To: caml-list@yquem.inria.fr Delivered-To: caml-list@yquem.inria.fr Received: from mail3-relais-sop.national.inria.fr (mail3-relais-sop.national.inria.fr [192.134.164.104]) by yquem.inria.fr (Postfix) with ESMTP id 480DDBBAF for ; Fri, 9 Jan 2009 18:53:24 +0100 (CET) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AgIBAI8dZ0lA6aq5mWdsb2JhbACTUz4BAQEBAQgLCgcRrzQIeotSAQMBA4VsgiA X-IronPort-AV: E=Sophos;i="4.37,240,1231110000"; d="scan'208";a="21265119" Received: from rn-out-0910.google.com ([64.233.170.185]) by mail3-smtp-sop.national.inria.fr with ESMTP; 09 Jan 2009 18:53:23 +0100 Received: by rn-out-0910.google.com with SMTP id j66so6433271rne.20 for ; Fri, 09 Jan 2009 09:53:22 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:from:reply-to:to:subject:date :user-agent:cc:references:in-reply-to:content-type :content-transfer-encoding:content-disposition:message-id; bh=5QIO+ETg1rg58e33aNz+ZELFsN9tfTnT0UVngYzps6w=; b=TLsu2uYasZl50HjU41g8V300bFTdhrJrE+3o7lKNGO8Mw+ynFEXAc0FLvhE4yIEad6 K7czeK6ge67Yv80PFLZSXmbaTJINrmojAcCv/c1XD8EGJ/uWMyAjmF8WlMA1ItnqgmRA UYrJBnRWGQJDYfHjxahFv3xUid58yNMXNadbc= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=from:reply-to:to:subject:date:user-agent:cc:references:in-reply-to :content-type:content-transfer-encoding:content-disposition :message-id; b=vaW4TDoFV2jDyoTsIch2VmfFuOtNHjFnefdyGMggV8fkVegpUuHEALIOdhVkZXHgJQ Og6yO5zr0sr3+o3YfgCA1TY2Ik+YEkbUUxf5f64iAp3DfipXHP0/e+WTB8W0PXblCZlJ R1ViJf6KJSc58OGzNISH+9LTPLsohyl52hLvE= Received: by 10.100.163.8 with SMTP id l8mr13899743ane.127.1231523602373; Fri, 09 Jan 2009 09:53:22 -0800 (PST) Received: from ?192.168.0.102? (c-24-99-180-210.hsd1.ga.comcast.net [24.99.180.210]) by mx.google.com with ESMTPS id b37sm28268881ana.30.2009.01.09.09.53.21 (version=TLSv1/SSLv3 cipher=RC4-MD5); Fri, 09 Jan 2009 09:53:21 -0800 (PST) From: Peng Zang Reply-To: peng.zang@gmail.com To: caml-list@yquem.inria.fr Subject: Re: [Caml-list] Toplevel - loading dependencies Date: Fri, 9 Jan 2009 12:53:16 -0500 User-Agent: KMail/1.9.9 Cc: Dawid Toton References: <49675DE7.5030000@uj.edu.pl> In-Reply-To: <49675DE7.5030000@uj.edu.pl> Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200901091253.19895.peng.zang@gmail.com> X-Spam: no; 0.00; toplevel:01 dependencies:01 hash:01 ocamldep:01 dependencies:01 toplevel:01 cmo:01 prepend:01 cmo:01 ocaml:01 aggregates:01 recompile:01 beginner's:01 ocaml:01 bug:01 -----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-----