From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (from majordomo@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id VAA01815; Wed, 7 Apr 2004 21:50:47 +0200 (MET DST) X-Authentication-Warning: pauillac.inria.fr: majordomo set sender to owner-caml-list@pauillac.inria.fr using -f Received: from concorde.inria.fr (concorde.inria.fr [192.93.2.39]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id VAA01866 for ; Wed, 7 Apr 2004 21:50:46 +0200 (MET DST) Received: from main.gmane.org (main.gmane.org [80.91.224.249]) by concorde.inria.fr (8.12.10/8.12.10) with ESMTP id i37JojYM011181 for ; Wed, 7 Apr 2004 21:50:46 +0200 Received: from root by main.gmane.org with local (Exim 3.35 #1 (Debian)) id 1BBJ4P-0001fO-00 for ; Wed, 07 Apr 2004 21:50:45 +0200 X-Injected-Via-Gmane: http://gmane.org/ To: caml-list@inria.fr From: John Goerzen Subject: [Caml-list] Dynamically evaluating OCaml code Date: Wed, 7 Apr 2004 18:47:30 +0000 (UTC) Organization: Complete.Org Message-ID: X-Complaints-To: usenet@complete.org User-Agent: slrn/0.9.8.0 (Linux) X-Miltered: at concorde by Joe's j-chkmail ("http://j-chkmail.ensmp.fr")! X-Loop: caml-list@inria.fr X-Spam: no; 0.00; dynamically:01 python:01 python's:01 python:01 usr:01 bin:01 evaluates:01 ocaml:01 ocaml:01 string:03 complex:03 seems:05 source:07 source:07 top-level:07 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk X-Status: X-Keywords: X-UID: 108 Hello, I am moving from Python to OCaml and one of the things I miss is Python's eval() call. It takes a string representing a bit of Python source code, evaluates it, and returns the result. I would like to be able to do similar things with OCaml. I have observed that /usr/bin/ocaml, the interactive top-level, is itself written in OCaml, which suggests that this should be possible. Although I have tried to study the source for this, it seems extremely complex and I can't figure out a way to do the simple evaluation described above. Can anyone help me out here? Thanks, John ------------------- 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