caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Richard Jones <rich@annexia.org>
To: Dawid Toton <d0@wp.pl>
Cc: caml-list@yquem.inria.fr
Subject: Re: [Caml-list] Toplevel - load cmo from given location
Date: Fri, 9 Jan 2009 21:39:24 +0000	[thread overview]
Message-ID: <20090109213924.GA9963@annexia.org> (raw)
In-Reply-To: <49676862.9090406@wp.pl>

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


  reply	other threads:[~2009-01-09 21:39 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-01-09 14:06 Dawid Toton
2009-01-09 14:39 ` [Caml-list] " Christophe TROESTLER
2009-01-09 15:08   ` Dawid Toton
2009-01-09 21:39     ` Richard Jones [this message]
2009-01-09 17:33 ` Zheng Li

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=20090109213924.GA9963@annexia.org \
    --to=rich@annexia.org \
    --cc=caml-list@yquem.inria.fr \
    --cc=d0@wp.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).