You could put your #load and open statements in a .ocamlinit file :
this file, if present is read by the toplevel. Additionally you can
put a #use "source.ml" in this file, to load your source as well. If
you intend to use the toplevel, you should consider rlwrap, which
makes it so much comfortable.
For threads, have you tried
Maybe you need a
#directory "+threads" before this ?
I cannot check right now. Otherwise you could build a custom toplevel.
It is very easy with ocamlbuid.
Le 6 mai 2011 à 17:41, Chantal Keller <chantal.keller@...
> Hello Jeff,
> Le 06/05/2011 17:23, Jeff Massung a écrit :
>> 1. How can I properly write my source file so that it can #load and
>> without having to go back and forth editing my source file? For
>> #load "unix.cma" ;;
>> open Unix
>> The above is perfect for the interpreter, but fails miserably when
>> I try and
>> compile. Similarly, I assume that if I tried to compile with ocamlopt
>> instead of ocamlc that I'd need "unix.cmx" instead?
> Just remove [#load ...] and compile with:
> ocamlc -o myprog unix.cma myfile.ml
> ocamlopt -o myprog unix.cmxa myfile.ml
> A nice way to compile OCaml programs without taking much care of such
> things is to use OMake <http://omake.metaprl.org/index.html>.
> Chantal KELLER
> Archives up to December 31, 2010 are also downloadable at http://www.connettivo.net/cntprojects/ocaml_beginners
> The archives of the very official ocaml list (the seniors' one) can
> be found at http://caml.inria.fr
> Attachments are banned and you're asked to be polite, avoid flames
> etc.Yahoo! Groups Links