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.8 required=5.0 tests=AWL,SPF_FAIL 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 20DF0BBAF for ; Fri, 9 Jan 2009 22:39:28 +0100 (CET) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AmkDAEpSZ0lQRFuwgWdsb2JhbACUEQEBFiKwLos1hW8 X-IronPort-AV: E=Sophos;i="4.37,241,1231110000"; d="scan'208";a="33526125" Received: from furbychan.cocan.org ([80.68.91.176]) by mail4-smtp-sop.national.inria.fr with ESMTP/TLS/AES256-SHA; 09 Jan 2009 22:39:27 +0100 Received: from rich by furbychan.cocan.org with local (Exim 4.63) (envelope-from ) id 1LLP4f-0003yE-1a; Fri, 09 Jan 2009 21:39:25 +0000 Date: Fri, 9 Jan 2009 21:39:24 +0000 To: Dawid Toton Cc: caml-list@yquem.inria.fr Subject: Re: [Caml-list] Toplevel - load cmo from given location Message-ID: <20090109213924.GA9963@annexia.org> References: <496759E1.3070104@uj.edu.pl> <20090109.153939.9450351754532580.Christophe.Troestler+ocaml@umons.ac.be> <49676862.9090406@wp.pl> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <49676862.9090406@wp.pl> User-Agent: Mutt/1.5.13 (2006-08-11) From: Richard Jones X-Spam: no; 0.00; toplevel:01 cmo:01 enum:01 cmo:01 cmi:01 cmi:01 toplevel:01 bug:01 one-to-one:01 ocamlfind:01 topfind:01 findlib:01 camlp:01 camlp:01 syntax:01 On Fri, Jan 09, 2009 at 03:08:18PM +0000, Dawid Toton wrote: > > >>The problem is that it gives "Unbound module Enum" while no error about > >>loading the cmo&cmi is shown. > > > >The #directory instruction is needed to find the .cmi. > > I see, so there are 2 problems: > * why the failure to load cmi is silent in this case? > * why the toplevel fails to check for cmi where the cmo is located? This > looks as incorrect behaviour (the reference manual doesn't mention any > exceptional rules for the #load directive). As you say this is kind of a bug. You cannot solve it by assuming some sort of one-to-one relationship between .cmi files and .cmo files though. You can have .cmi without .cmo, or .cmo without .cmi, or lots of .cmi and a .cma, and probably other combinations. Couple of practical points though: (1) Use ocamlfind in the toplevel to solve all these problems: # #use "topfind";; - : unit = () Findlib has been successfully loaded. Additional directives: #require "package";; to load a package #list;; to list the available packages #camlp4o;; to load camlp4 (standard syntax) #camlp4r;; to load camlp4 (revised syntax) #predicates "p,q,...";; to set these predicates Topfind.reset();; to force that packages will be reloaded #thread;; to enable threads - : unit = () # #require "netstring";; /usr/lib64/ocaml/pcre: added to search path /usr/lib64/ocaml/pcre/pcre.cma: loaded /usr/lib64/ocaml/unix.cma: loaded /usr/lib64/ocaml/netsys: added to search path /usr/lib64/ocaml/netsys/netsys.cma: loaded /usr/lib64/ocaml/netstring: added to search path /usr/lib64/ocaml/netstring/netstring.cma: loaded /usr/lib64/ocaml/netstring/netstring_top.cmo: loaded /usr/lib64/ocaml/netstring/netaccel.cma: loaded /usr/lib64/ocaml/netstring/netaccel_link.cmo: loaded (2) Bugs should go in the bug tracker here: http://caml.inria.fr/mantis/ Rich. -- Richard Jones Red Hat