How to import a source file to OCaml's toplevel?

How to import a source file to OCaml's toplevel? Say, I want to use a function implemented in a source file in the toplevel.

asked Apr 18, 2013 by Peter M. (1,270 points)

1 Answer

 
Best answer
#use "file-name";; 

Read, compile and execute source phrases from the given file. This is textual inclusion: phrases are processed just as
if they were typed on standard input. The reading of the file stops at
the first error encountered.

More Toplevel directives: http://caml.inria.fr/pub/docs/manual-ocaml-4.00/manual023.html

answered Apr 19, 2013 by anonymous
selected Apr 21, 2013 by Peter M.

Please log in or register to answer this question.

Copyright © SysTutorials. User contributions licensed under cc-wiki with attribution required.
Hosted on Dreamhost

...