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 WAA05121; Wed, 7 Apr 2004 22:39:41 +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 WAA04645 for ; Wed, 7 Apr 2004 22:39:40 +0200 (MET DST) Received: from gatekeeper.elmer.external.excelhustler.com (gatekeeper.excelhustler.com [68.99.114.105]) by concorde.inria.fr (8.12.10/8.12.10) with ESMTP id i37KdcYM017763 for ; Wed, 7 Apr 2004 22:39:39 +0200 Received: from chatterbox.elmer.internal.excelhustler.com (unknown [192.168.0.12]) (using TLSv1 with cipher EDH-RSA-DES-CBC3-SHA (168/168 bits)) (Client CN "chatterbox.elmer.internal.excelhustler.com", Issuer "excelhustler.com" (not verified)) by gatekeeper.elmer.external.excelhustler.com (Postfix) with ESMTP id 2CE4DE0180; Wed, 7 Apr 2004 15:39:38 -0500 (CDT) Received: from localhost (localhost [127.0.0.1]) by chatterbox.elmer.internal.excelhustler.com (Postfix) with ESMTP id EA72E5C006; Wed, 7 Apr 2004 15:39:37 -0500 (CDT) Received: from wile.internal.excelhustler.com (wile.internal.excelhustler.com [192.168.1.34]) by chatterbox.elmer.internal.excelhustler.com (Postfix) with ESMTP id C20875C005; Wed, 7 Apr 2004 15:39:37 -0500 (CDT) Received: by wile.internal.excelhustler.com (Postfix, from userid 1000) id 56F3910051; Wed, 7 Apr 2004 15:39:38 -0500 (CDT) Date: Wed, 7 Apr 2004 15:39:38 -0500 From: John Goerzen To: Vitaly Lugovsky Cc: caml-list@inria.fr Subject: Re: [Caml-list] Dynamically evaluating OCaml code Message-ID: <20040407203938.GC26323@excelhustler.com> References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.5.1+cvs20040105i X-Scanned-By: clamscan at chatterbox.elmer.internal.excelhustler.com 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; caml-list:01 dynamically:01 2004:99 0400,:01 vitaly:01 lugovsky:01 python:01 python's:01 python:01 obsoleted:01 powerfull:01 usr:01 imitate:01 bin:01 compiler:01 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk X-Status: X-Keywords: X-UID: 112 On Thu, Apr 08, 2004 at 01:32:41AM +0400, Vitaly Lugovsky wrote: > > On Wed, 7 Apr 2004, John Goerzen wrote: > > > 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. > > OCaml is a compiler, not interpreter. But, you'll find that this > feature is obsoleted by the partial application - it's a much > more powerfull device then lispish eval, and it can be even a > replacement for a macros. I don't think that will help me here; I'm looking at being able to let people insert OCaml expressions directly into otherwise plain-text config files. And while I understand your general point about OCaml being a compiler, I think you'd have to admit that this line is at least blurred by the interactive toplevel *interpreter* /usr/bin/ocaml :-) It is a subset of that program's functionality that I seek to imitate. -- 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