caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* ocamlmktop has a weird behaviour
@ 2010-06-27 17:34 Loup Vaillant
  2010-06-27 17:48 ` [Caml-list] " Stéphane Glondu
  2010-06-27 22:37 ` Mauricio Fernandez
  0 siblings, 2 replies; 3+ messages in thread
From: Loup Vaillant @ 2010-06-27 17:34 UTC (permalink / raw)
  To: caml-list

Hello,
I am trying to write a makefile entry to build an ocaml toplevel
(version 3.11.1, default Ubuntu 9.10 install).

My problem is very simple. First, the following works as expected:

$ ls lib
batteries.ml
$ cd lib
$ ocamlc -c batteries.ml
$ ocamlmktop -o ../ocamltop batteries.cmo
$ ../ocamltop
        Objective Caml version 3.11.1

# open Batteries;;
#

The module Batteries has been loaded in the interactive loop as
intended. Now, this *doesn't* work:

$ ls lib
batteries.ml
$ ocamlc -c lib/batteries.ml
$ ocamlmktop -o ocamltop -I lib batteries.cmo
$ ocamltop
        Objective Caml version 3.11.1

# open Batteries;;
Error: Unbound module Batteries
#

??? This looks like a super-obvious bug, so I must have overlook
something. Any idea what? Is it possible to built a sensible toplevel
with libraries *not* in the current directory? How?

Thanks,
Loup.


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [Caml-list] ocamlmktop has a weird behaviour
  2010-06-27 17:34 ocamlmktop has a weird behaviour Loup Vaillant
@ 2010-06-27 17:48 ` Stéphane Glondu
  2010-06-27 22:37 ` Mauricio Fernandez
  1 sibling, 0 replies; 3+ messages in thread
From: Stéphane Glondu @ 2010-06-27 17:48 UTC (permalink / raw)
  To: Loup Vaillant; +Cc: caml-list

Le 27/06/2010 19:34, Loup Vaillant a écrit :
> [...] Now, this *doesn't* work:
> 
> $ ls lib
> batteries.ml
> $ ocamlc -c lib/batteries.ml
> $ ocamlmktop -o ocamltop -I lib batteries.cmo
> $ ocamltop
>         Objective Caml version 3.11.1
> 
> # open Batteries;;
> Error: Unbound module Batteries

Are you sure you don't have an ocamltop executable in your $PATH that
gets executed?

-- 
Stéphane


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [Caml-list] ocamlmktop has a weird behaviour
  2010-06-27 17:34 ocamlmktop has a weird behaviour Loup Vaillant
  2010-06-27 17:48 ` [Caml-list] " Stéphane Glondu
@ 2010-06-27 22:37 ` Mauricio Fernandez
  1 sibling, 0 replies; 3+ messages in thread
From: Mauricio Fernandez @ 2010-06-27 22:37 UTC (permalink / raw)
  To: caml-list

On Sun, Jun 27, 2010 at 07:34:08PM +0200, Loup Vaillant wrote:
> My problem is very simple. First, the following works as expected:
> 
> $ ls lib
> batteries.ml
> $ cd lib
> $ ocamlc -c batteries.ml
> $ ocamlmktop -o ../ocamltop batteries.cmo
> $ ../ocamltop
>         Objective Caml version 3.11.1
> 
> # open Batteries;;
> #
> 
> The module Batteries has been loaded in the interactive loop as
> intended. Now, this *doesn't* work:
> 
> $ ls lib
> batteries.ml
> $ ocamlc -c lib/batteries.ml
> $ ocamlmktop -o ocamltop -I lib batteries.cmo
> $ ocamltop
>         Objective Caml version 3.11.1
> 
> # open Batteries;;
> Error: Unbound module Batteries
> #
> 
> ??? This looks like a super-obvious bug, so I must have overlook
> something. Any idea what? Is it possible to built a sensible toplevel
> with libraries *not* in the current directory? How?

The problem is not the library itself, but rather the associated .cmi files,
which the toplevel requires. You can either give the  -I lib  arguments to
ocamltop, or use the  #directory "lib";;  directive in the toplevel.

-- 
Mauricio Fernandez  -   http://eigenclass.org


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2010-06-27 22:37 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-06-27 17:34 ocamlmktop has a weird behaviour Loup Vaillant
2010-06-27 17:48 ` [Caml-list] " Stéphane Glondu
2010-06-27 22:37 ` Mauricio Fernandez

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).