caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Damien Doligez <damien.doligez@inria.fr>
To: briand@aracnet.com
Cc: caml-list@pauillac.inria.fr
Subject: [Caml-list] Re:
Date: Tue, 24 Aug 2004 11:09:28 +0200	[thread overview]
Message-ID: <4D4C90B6-F5AD-11D8-B0E6-00039310CAE8@inria.fr> (raw)
In-Reply-To: <16682.21287.26129.98212@soggy.deldotd.com>

On Aug 23, 2004, at 22:27, briand@aracnet.com wrote:

> ~/src/ocaml/math $ ocaml
>         Objective Caml version 3.08.0
>
> # #load "const.cmo";;
> # Const.pi
>   ;;
> - : float = 3.14159265358979312
> #
>
>
> ~/src/ocaml/math $ cd ..
> ~/src/ocaml $ cd pll
> ~/src/ocaml/pll $ ocaml
>         Objective Caml version 3.08.0
>
> # #load "../math/const.cmo";;
> # Const.pi;;
> Unbound value Const.pi
>
> Huh ??

What is the type of Const.pi?  In order to answer this question, you 
have
to know the interface of module Const.  This interface lives in 
const.mli,
which is compiled to const.cmi.  It is automatically looked up in the
current directory, but not in ../math (unless you use option -I).

In other words, a module is composed of two things: its interface and
its implementation.  The interface is all you need to know at compile
time, while the implementation is all you need at execution time.  But
the toplevel does both compilation and execution, so it needs both.
The #load directive only provides the implementation.  You should also
add "../math" to the interface search path with the #directory 
directive:

# #load "../math/const.cmo";;
# #directory "../math";;
# Const.pi;;

-- Damien

-------------------
To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr
Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners


  parent reply	other threads:[~2004-08-24  9:09 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-08-23 20:27 briand
2004-08-23 20:36 ` [Caml-list] Re : [path directives] Jean-Baptiste Rouquier
2004-08-24  1:41   ` briand
2004-08-24  1:54     ` Jacques GARRIGUE
2004-08-25 18:54       ` briand
2004-08-24  9:09 ` Damien Doligez [this message]
  -- strict thread matches above, loose matches on Subject: below --
2021-04-07 11:50 [Caml-list] Fabien / maufred
2021-04-07 12:50 ` [Caml-list] RE : Jean-Denis EIDEN
2011-04-07 14:21 [Caml-list] nathalielibertine
     [not found] <200404290855.i3T8sxxM001342@host2.route66.net>
2004-04-29  8:55 ` alex
2003-07-24  4:20 [Caml-list] Graphics frustration Matt Gushee
2003-07-26  1:37 ` SooHyoung Oh
2003-07-26  8:59   ` [Caml-list] Nicolas Janin
2003-03-08  8:53 Vee Satayamas
2003-03-08  9:06 ` [Caml-list] Seth Kurtzberg
2003-03-10 16:51   ` Brian Hurt
2002-10-19 17:14 climb
2002-10-20 20:15 ` [Caml-list] Alessandro Baretta
2002-06-17  1:12 [Caml-list] Problem with Graph module Nicolas FRANCOIS
2002-06-17 13:23 ` Jun P.FURUSE
2002-06-17 17:47   ` [Caml-list] Nicolas FRANCOIS
2002-02-17 16:05 francois.hugel
2002-02-23 20:56 ` [Caml-list] Nicolas FRANCOIS
2002-02-24 18:07   ` stalkern2

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=4D4C90B6-F5AD-11D8-B0E6-00039310CAE8@inria.fr \
    --to=damien.doligez@inria.fr \
    --cc=briand@aracnet.com \
    --cc=caml-list@pauillac.inria.fr \
    /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).