English version
Accueil     À propos     Téléchargement     Ressources     Contactez-nous    

Ce site est rarement mis à jour. Pour les informations les plus récentes, rendez-vous sur le nouveau site OCaml à l'adresse ocaml.org.

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 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