Version française
Home     About     Download     Resources     Contact us    
Browse thread
Re: [Caml-list] how to use a module
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Matt Gushee <mgushee@h...>
Subject: Re: [Caml-list] how to use a module
On Mon, Jun 30, 2003 at 10:11:54PM +0200, Jean-Baptiste Rouquier wrote:
> 
> (*if you file is already compiled, you can use :*)
> #load "qux.cmo";;

If you know in advance what you want to load, you can also load it by
passing it as an argument to the toplevel, e.g.:

  $ ocaml qux.cmo

I prefer this approach because it cuts down on the characters I have to
retype when I make errors (Note to OCaml team: can we *please* get some
kind of history-editing functionality in the toplevel? I know there are
licensing and portability issues with GNU readline, but what about the
getline library used by OCaml2?)

This approach is also handy if you want to quickly check your syntax:

  $ ocaml my_new_module.ml

This doesn't give you an interactive shell, so it's different from
  
  $ ocaml
  # #use "my_new_module.ml";;

But it will tell you if there are errors in your code.

-- 
Matt Gushee                 When a nation follows the Way,
Englewood, Colorado, USA    Horses bear manure through
mgushee@havenrock.com           its fields;
http://www.havenrock.com/   When a nation ignores the Way,
                            Horses bear soldiers through
                                its streets.
                                
                            --Lao Tzu (Peter Merel, trans.)

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