caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Zheng Li <zheng_li@users.sourceforge.net>
To: Dawid Toton <dawid.toton@uj.edu.pl>
Cc: caml-list@yquem.inria.fr
Subject: Re: Toplevel - load cmo from given location
Date: Fri, 09 Jan 2009 18:33:24 +0100	[thread overview]
Message-ID: <49678A64.60907@users.sourceforge.net> (raw)
In-Reply-To: <496759E1.3070104@uj.edu.pl>

Hi,

On 1/9/2009 3:06 PM, Dawid Toton wrote:
> But this version not (using the full path directly):
>
> #!/usr/bin/ocamlrun ocaml
> #load "/home/dt2/Calc1/CalcEngine/src/_build/extlib/enum.cmo"
> open Enum
>
> The problem is that it gives "Unbound module Enum" while no error about
> loading the cmo&cmi is shown.

It's because the toplevel doesn't have the "/home/dt2/..." in its paths, 
so it doesn't know where the enum.cmi is.

> So:
> * if it finds correctly the enum.cmi: why "open Enum" doesn't work?

No, it doesn't find the enum.cmi

> * if the cmi is not found, why I see no message like "*Cannot find file
> */home/dt2/Calc1/CalcEngine/src/_build/extlib/enum.cmi*" - as chapter

The enum.cmi was there, it was because the toplevel didn't know about 
this path. So it had the same effect as accessing a non-existed module 
or a module existed but not in the known paths (e.g. open NoSuchModule).

> 9.4 of docs suggests? Does the toplevel check for the cmi in the same
> location as cmo? *

No. Basically, cmi and cmo are two different things. You using one 
doesn't mean you'll use the other.

Using the "directory" directive or launching toplevel with "-I" 
parameters can add extra paths to toplevel (for accessing both cmi and cmo).

HTH.
--
Zheng


      parent reply	other threads:[~2009-01-09 17:33 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
2009-01-09 17:33 ` Zheng Li [this message]

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=49678A64.60907@users.sourceforge.net \
    --to=zheng_li@users.sourceforge.net \
    --cc=caml-list@yquem.inria.fr \
    --cc=dawid.toton@uj.edu.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).