<?xml version="1.0" encoding="ISO-8859-1"?>

<!DOCTYPE message PUBLIC
  "-//MLarc//DTD MLarc output files//EN"
  "../../mlarc.dtd"[
  <!ATTLIST message
    listname CDATA #REQUIRED
    title CDATA #REQUIRED
  >
]>

  <?xml-stylesheet href="../../mlarc.xsl" type="text/xsl"?>


<message 
  url="2009/01/3884db1d1064e8341b9e0ba01c22eb72"
  from="Richard Jones &lt;rich@a...&gt;"
  author="Richard Jones"
  date="2009-01-09T21:39:28"
  subject="Re: [Caml-list] Toplevel - load cmo from given location"
  prev="2009/01/68a29877bfbd573954edce82da5f896a"
  next="2009/01/eabe0f1126a9d8c37e11c08054d99a36"
  prev-in-thread="2009/01/6e6d3c0326d97e4ac71e057ef3170786"
  next-in-thread="2009/01/f8a33f74e66883b70cf383c45b74875b"
  prev-thread="2009/01/5c289b2a10ec7c701b7b196284e19c78"
  next-thread="2009/01/8098af0c31ee2dfc908c6c4b9d081e1e"
  root="../../"
  period="month"
  listname="caml-list"
  title="Archives of the Caml mailing list">

<thread subject="Toplevel - load cmo from given location">
<msg 
  url="2009/01/2112b46e78c48d5a1e210bbd83ebb31a"
  from="Dawid Toton &lt;dawid.toton@u...&gt;"
  author="Dawid Toton"
  date="2009-01-09T14:06:49"
  subject="Toplevel - load cmo from given location">
<msg 
  url="2009/01/e089a87758b262aa447bde4a9388582e"
  from="Christophe TROESTLER &lt;Christophe.Troestler+ocaml@u...&gt;"
  author="Christophe TROESTLER"
  date="2009-01-09T14:40:25"
  subject="Re: [Caml-list] Toplevel - load cmo from given location">
<msg 
  url="2009/01/6e6d3c0326d97e4ac71e057ef3170786"
  from="Dawid Toton &lt;d0@w...&gt;"
  author="Dawid Toton"
  date="2009-01-09T15:08:29"
  subject="Re: [Caml-list] Toplevel - load cmo from given location">
<msg 
  url="2009/01/3884db1d1064e8341b9e0ba01c22eb72"
  from="Richard Jones &lt;rich@a...&gt;"
  author="Richard Jones"
  date="2009-01-09T21:39:28"
  subject="Re: [Caml-list] Toplevel - load cmo from given location">
</msg>
</msg>
</msg>
<msg 
  url="2009/01/f8a33f74e66883b70cf383c45b74875b"
  from="Zheng Li &lt;zheng_li@u...&gt;"
  author="Zheng Li"
  date="2009-01-09T17:33:11"
  subject="Re: Toplevel - load cmo from given location">
</msg>
</msg>
</thread>

<contents>
On Fri, Jan 09, 2009 at 03:08:18PM +0000, Dawid Toton wrote:
&gt; 
&gt; &gt;&gt;The problem is that it gives "Unbound module Enum" while no error about 
&gt; &gt;&gt;loading the cmo&amp;cmi is shown.
&gt; &gt;
&gt; &gt;The #directory instruction is needed to find the .cmi.
&gt; 
&gt; I see, so there are 2 problems:
&gt; * why the failure to load cmi is silent in this case?
&gt; * why the toplevel fails to check for cmi where the cmo is located? This 
&gt; looks as incorrect behaviour (the reference manual doesn't mention any 
&gt; 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

</contents>

</message>

