Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

[Caml-list] ocamlmktop has a weird behaviour

32 views
Skip to first unread message

Loup Vaillant

unread,
Jun 27, 2010, 1:34:16 PM6/27/10
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.

_______________________________________________
Caml-list mailing list. Subscription management:
http://yquem.inria.fr/cgi-bin/mailman/listinfo/caml-list
Archives: http://caml.inria.fr
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners
Bug reports: http://caml.inria.fr/bin/caml-bugs

Stéphane Glondu

unread,
Jun 27, 2010, 1:49:26 PM6/27/10
to Loup Vaillant, 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

Mauricio Fernandez

unread,
Jun 27, 2010, 6:39:02 PM6/27/10
to caml...@inria.fr

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

0 new messages