[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Running OCaml scripts from the command line

Dear OCamlers.
I am doing some quick and dirty OCamling, and while coding would like to execute my code in the toplevel, rather than first compiling it and then running my compiled binary.

if I have a file called test1.ml, for which the following works fine:

ocaml test1.ml 

But, now, if test1.ml uses the Test2 module (in test2.ml), I get a module missing exception. I get around this with:

ocaml test2.ml test1.ml

but when supplying both test2 and test1 to the ocaml toplevel, absolutely no code is executed at all.
I have tried to use the -I flag to add the current directory to the search path (which it should be by default?), but without any luck.

I haven't had any luck with ocamlfind either, and ocamlfind seems to be for finding third party libraries, rather than other modules within the same project?

I hope I am missing something trivial here.

Thank you, and have a great afternoon!

All the best,



Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.