caml-list - the Caml user's mailing list
 help / 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
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 index

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-02-23 18:02 francois.hugel
2002-02-23 20:48 ` [Caml-list] Nicolas FRANCOIS (AKA El Bofo)
2002-02-24 12:00   ` stalkern2
2002-06-17  1:04 [Caml-list] Problem with Graph module Nicolas FRANCOIS (AKA El Bofo)
2002-06-17 13:23 ` Jun P.FURUSE
2002-06-17 17:38   ` [Caml-list] Nicolas FRANCOIS (AKA El Bofo)
2002-10-19 17:14 climb
2002-10-20 20:04 ` [Caml-list] Alessandro Baretta
2003-03-08  8:53 Vee Satayamas
2003-03-08  9:06 ` [Caml-list] Seth Kurtzberg
2003-03-10 16:41   ` Brian Hurt
2003-07-24  4:20 [Caml-list] Graphics frustration Matt Gushee
2003-07-26  1:37 ` SooHyoung Oh
2003-07-26  8:58   ` [Caml-list] Nicolas Janin
     [not found] <200404290855.i3T8sxxM001342@host2.route66.net>
2004-04-29  8:55 ` alex
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]
2011-04-07 14:20 [Caml-list] nathalielibertine
2021-04-07 11:51 [Caml-list] Fabien / maufred
2021-04-07 12:50 ` [Caml-list] RE : Jean-Denis EIDEN

Reply instructions:

You may reply publically 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

caml-list - the Caml user's mailing list

Archives are clonable: git clone --mirror https://inbox.ocaml.org/caml-list

AGPL code for this site: git clone https://public-inbox.org/ public-inbox