caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* [Caml-list] how to use a module
@ 2003-06-27 18:05 Jung Woon Ho
  0 siblings, 0 replies; 4+ messages in thread
From: Jung Woon Ho @ 2003-06-27 18:05 UTC (permalink / raw)
  To: caml-list

[-- Attachment #1: Type: text/html, Size: 873 bytes --]

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

* Re: [Caml-list] how to use a module
  2003-07-01  1:49 ` Matt Gushee
@ 2003-07-01 10:32   ` Remi Vanicat
  0 siblings, 0 replies; 4+ messages in thread
From: Remi Vanicat @ 2003-07-01 10:32 UTC (permalink / raw)
  To: caml-list

Matt Gushee <mgushee@havenrock.com> writes:

> (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?)


ledit is there for this. You can found it in the ocaml bazaar :
http://caml.inria.fr/distrib/bazar-ocaml/

[...]


-- 
Rémi Vanicat
vanicat@labri.u-bordeaux.fr
http://dept-info.labri.u-bordeaux.fr/~vanicat

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


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

* Re: [Caml-list] how to use a module
  2003-06-30 20:11 Jean-Baptiste Rouquier
@ 2003-07-01  1:49 ` Matt Gushee
  2003-07-01 10:32   ` Remi Vanicat
  0 siblings, 1 reply; 4+ messages in thread
From: Matt Gushee @ 2003-07-01  1:49 UTC (permalink / raw)
  To: caml-list

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


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

* Re: [Caml-list] how to use a module
@ 2003-06-30 20:11 Jean-Baptiste Rouquier
  2003-07-01  1:49 ` Matt Gushee
  0 siblings, 1 reply; 4+ messages in thread
From: Jean-Baptiste Rouquier @ 2003-06-30 20:11 UTC (permalink / raw)
  To: caml-list

>I'm having trouble (using the modules or the files that I wrote)   (in the
interactive mode of  OCaml).


(*First, let Caml know where you put your files if they aren't in the
current directory :*)
#directory "foo/bar";;

(*This is the "include" directive (see the manual) :*)
#use "baz.ml";;

(*if you file is already compiled, you can use :*)
#load "qux.cmo";;

(*but you have to "#load" all the files that egg uses, for instance if
egg.ml contains "Graphics.open_graph", then you must load graphics before
(as when you link the main programm) :*)
#load "graphics.cma";;
#load "egg.cmo";;

(*If you want to state "quz ()" instead of "Egg.quz ()", just open this
module (it requires egg.cmi in the list of searching directories) :*)
open Egg;;

JB


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


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

end of thread, other threads:[~2003-07-01 10:31 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-06-27 18:05 [Caml-list] how to use a module Jung Woon Ho
2003-06-30 20:11 Jean-Baptiste Rouquier
2003-07-01  1:49 ` Matt Gushee
2003-07-01 10:32   ` Remi Vanicat

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