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=0.0 required=5.0 tests=none autolearn=disabled version=3.1.3 X-Original-To: caml-list@yquem.inria.fr Delivered-To: caml-list@yquem.inria.fr Received: from mail4-relais-sop.national.inria.fr (mail4-relais-sop.national.inria.fr [192.134.164.105]) by yquem.inria.fr (Postfix) with ESMTP id D6AF4BBAF for ; Fri, 9 Jan 2009 15:23:39 +0100 (CET) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: Aj4CAFrsZkmVnFmTgWdsb2JhbACUEQEBFiKwRYVchS6Fbw X-IronPort-AV: E=Sophos;i="4.37,239,1231110000"; d="scan'208";a="33509935" Received: from mail.uj.edu.pl ([149.156.89.147]) by mail4-smtp-sop.national.inria.fr with ESMTP; 09 Jan 2009 15:23:39 +0100 MIME-version: 1.0 Content-transfer-encoding: 7BIT Content-type: text/plain; charset=ISO-8859-1; format=flowed Received: from [137.73.5.196] by mail.uj.edu.pl (Sun Java(tm) System Messaging Server 6.3-5.02 (built Oct 12 2007; 32bit)) with ESMTPA id <0KD70075LJZDSHE0@mail.uj.edu.pl> for caml-list@yquem.inria.fr; Fri, 09 Jan 2009 15:23:38 +0100 (CET) X-Antivirus-Code: 100000 X-Antivirus: Dr.Web (R) for Mail Servers on pandora host Message-id: <49675DE7.5030000@uj.edu.pl> Date: Fri, 09 Jan 2009 14:23:35 +0000 From: Dawid Toton User-Agent: Thunderbird 1.5.0.12 (X11/20090107) To: caml-list@yquem.inria.fr Subject: Toplevel - loading dependencies X-Spam: no; 0.00; toplevel:01 dependencies:01 toplevel:01 cmo:01 prepend:01 cmo:01 dependencies:01 ocaml:01 aggregates:01 recompile:01 undefined:01 undefined:01 cma:01 cma:01 modules:02 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