Version franēaise
Home     About     Download     Resources     Contact us    

This site is updated infrequently. For up-to-date information, please visit the new OCaml website at

Browse thread
[Caml-list] scripting ocaml from inside of ocaml
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2003-07-01 (09:54)
From: Jean-Christophe Filliatre <Jean-Christophe.Filliatre@l...>
Subject: Re: [Caml-list] scripting ocaml from inside of ocaml

Chris GauthierDickey writes:
 >   I've searched the FAQs, manuals, and mailing lists to no avail. I have an
 > application that I'm writing in ocaml, and I need to do some scripting for
 > the program. I'd like to use ocaml as the scripting language. I've seen
 > references to using ocaml to interpret scripts from files, etc, but these
 > all assume that your environment is closed to the scripting. In particular,
 > I would like to be able to use ocaml to interpret scripts, have scripts
 > refer to objects that I import into their environment, and be able to take
 > values from their bindings in the scripts environment and use them in my
 > ocaml code.

There may  be another solution  to your problem  if you are  fine with
running bytecode only:  you can build your program on  top of an ocaml
toplevel (with ocamlmktop) and  then use Topdirs.dir_use (the function
which realizes #use in the toplevel) to interpret your ocaml scripts.

Hope this helps,
Jean-Christophe Filliātre (

To unsubscribe, mail Archives:
Bug reports: FAQ:
Beginner's list: