Version française
Home     About     Download     Resources     Contact us    
Browse thread
[Caml-list] Embedding OCaml
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: clement <clement.capel@f...>
Subject: Re: [Caml-list] Embedding OCaml


Hello,

I have got another solution to possibly resolve this
problem: 
I've developed an embedded O'Caml toplevel
which integrates the runtime and the compiler of O'Caml.
Actually, it's a dynamic linked library (in C) builds using 
the "ouput-obj" option; i have solved the problem of 
the symbole table thanks to a modification of the 
compiler and the runtime.

you can download the patch at this url: 
http://www.pps.jussieu.fr/~capel/eng/toplevel/toplevel.html

you will find also an O'Caml plugin for Excel and Netscape in this page.


Just an example to show you how it works (in C):
(you can also use the directives #use and #load)

  toplevel_init(argv);

  toplevel_exec("let rec ack m n = 
                 match m,n with 0,n -> n+1            
               | m,0 -> ack (m-1) 1                   
               | m,n -> (ack (m-1) ack m (n-1))");
    
  val = toplevel_exec("ack 3 2;;");
  res = 1+Long_val(val);

  printf ("1+ack(3,2)=%dn", res);


I hope it will help you.


              Clément Capel

-------------------
To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr
Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners