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 WAA22256; Fri, 10 May 2002 22:40:37 +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 WAA22273 for ; Fri, 10 May 2002 22:40:36 +0200 (MET DST) Received: from ext-nj2gw-3.online-age.net (ext-nj2gw-3.online-age.net [216.35.73.165]) by nez-perce.inria.fr (8.11.1/8.11.1) with ESMTP id g4AKeYH02218 for ; Fri, 10 May 2002 22:40:35 +0200 (MET DST) Received: from int-nj2gw-3.online-age.net (int-nj2gw-3.online-age.net [3.159.236.67]) by ext-nj2gw-3.online-age.net (8.9.3+Sun/8.9.1/990426-RLH) with ESMTP id QAA16875; Fri, 10 May 2002 16:40:32 -0400 (EDT) Received: from uswaumsxb4medge.med.ge.com (localhost [127.0.0.1]) by int-nj2gw-3.online-age.net (8.9.3+Sun/8.9.1/990426-RLH) with ESMTP id QAA01015; Fri, 10 May 2002 16:40:31 -0400 (EDT) Received: by USWAUMSXB4MEDGE with Internet Mail Service (5.5.2653.19) id ; Fri, 10 May 2002 15:39:56 -0500 Message-ID: From: "Gurr, David (MED, self)" To: =?iso-8859-1?Q?Sami_M=E4kel=E4?= , =?iso-8859-1?Q?Coletta_R=E9mi?= Cc: caml-list@inria.fr Subject: RE: [Caml-list] # eval line; (?) Date: Fri, 10 May 2002 15:39:50 -0500 MIME-Version: 1.0 X-Mailer: Internet Mail Service (5.5.2653.19) Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk I think that there is a small catch. I think that the definition of=20 eval is correct, but that if you use it in a toplevel loop, then it will fail because of the parser not reenterant. -D > -----Original Message----- > From: Sami M=E4kel=E4 [mailto:sajuma@utu.fi] > Sent: Thursday, May 09, 2002 12:23 PM > To: Coletta R=E9mi > Cc: caml-list@inria.fr > Subject: Re: [Caml-list] # eval line; (?) >=20 >=20 > > # line;; > > - : string =3D "let b =3D 1;;" > >=20 > > # b;; > > ^ > > Unbound value b > >=20 > > I'm looking for a function like "eval" in LISP, that does > >=20 > > # eval line; > > -: int =3D 1 > >=20 > > #b;; > > - : int =3D 1 >=20 > Try: >=20 > let eval str =3D > Toploop.execute_phrase true Format.std_formatter > (!Toploop.parse_toplevel_phrase (Lexing.from_string str));; > ------------------- > To unsubscribe, mail caml-list-request@inria.fr Archives:=20 > http://caml.inria.fr > Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ:=20 http://caml.inria.fr/FAQ/ Beginner's list: http://groups.yahoo.com/group/ocaml_beginners ------------------- 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