You can try ocaml_plugin (also uses dynlink but will compile the .ml file before loading, I've also never tried it from the OCaml repl):

https://github.com/janestreet/ocaml_plugin

On 7 June 2016 at 22:48, Sébastien Hinderer <Sebastien.Hinderer@inria.fr> wrote:
Nicolas Ratier (2016/06/07 14:40 +0200):
> Hello,
>
> Is there a way to include files dynamically ?
> a kind of :
>
> let aaa = "myfile.ml";;
> #use aaa;;
>
> Thanks,

Have you looked at the dynlink module?

As far as I know it can load only object files so you would have to
compile your .ml file before. Not sure there is a better alternative.

Sébastien.

--
Caml-list mailing list.  Subscription management and archives:
https://sympa.inria.fr/sympa/arc/caml-list
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners
Bug reports: http://caml.inria.fr/bin/caml-bugs



--
-barkmadley
sent from an internet enabled device
http://barkmadley.com