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 VAA31312; Thu, 9 May 2002 21:25:45 +0200 (MET DST) X-Authentication-Warning: pauillac.inria.fr: majordomo set sender to owner-caml-list@pauillac.inria.fr using -f Received: from nez-perce.inria.fr (nez-perce.inria.fr [192.93.2.78]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id VAA31065 for ; Thu, 9 May 2002 21:25:44 +0200 (MET DST) Received: from mailhost.utu.fi (mailhost.utu.fi [130.232.1.5]) by nez-perce.inria.fr (8.11.1/8.11.1) with ESMTP id g49JPhr06803 for ; Thu, 9 May 2002 21:25:43 +0200 (MET DST) Received: from utu.fi (glubimox.yok.utu.fi [130.232.134.107]) by mailhost.utu.fi (Postfix) with ESMTP id B3F974B02; Thu, 9 May 2002 22:22:30 +0300 (EET DST) Message-ID: <3CDACC83.563B15A1@utu.fi> Date: Thu, 09 May 2002 22:22:43 +0300 From: Sami =?iso-8859-1?Q?M=E4kel=E4?= Organization: - X-Mailer: Mozilla 4.77 [en] (X11; U; Linux 2.2.19 i686) X-Accept-Language: en MIME-Version: 1.0 To: Coletta =?iso-8859-1?Q?R=E9mi?= Cc: caml-list@inria.fr Subject: Re: [Caml-list] # eval line; (?) References: <20020509155828.4015de6d.remi.coletta@free.fr> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk > # line;; > - : string = "let b = 1;;" > > # b;; > ^ > Unbound value b > > I'm looking for a function like "eval" in LISP, that does > > # eval line; > -: int = 1 > > #b;; > - : int = 1 Try: let eval str = Toploop.execute_phrase true Format.std_formatter (!Toploop.parse_toplevel_phrase (Lexing.from_string str));; ------------------- 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