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] Embedding OCaml
[ Home ] [ Index: by date | by threads ]
[ Search: ]

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


I have got another solution to possibly resolve this
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:

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_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 Archives:
Bug reports: FAQ:
Beginner's list: