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 UAA19455; Fri, 10 May 2002 20:08:36 +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 UAA19382 for ; Fri, 10 May 2002 20:08:35 +0200 (MET DST) Received: from relay.pair.com (relay1.pair.com [209.68.1.20]) by concorde.inria.fr (8.11.1/8.11.1) with SMTP id g4AI8Yn12413 for ; Fri, 10 May 2002 20:08:35 +0200 (MET DST) Received: (qmail 17244 invoked from network); 10 May 2002 18:08:32 -0000 Received: from adsl-host-sf-228.apexworld.net (HELO checkerlap.d6.com) (66.114.212.228) by relay1.pair.com with SMTP; 10 May 2002 18:08:32 -0000 X-pair-Authenticated: 66.114.212.228 Message-Id: <4.3.2.7.2.20020510105628.03394360@mail.d6.com> X-Sender: checker@mail.d6.com X-Mailer: QUALCOMM Windows Eudora Version 4.3.2 Date: Fri, 10 May 2002 11:02:22 -0700 To: Sami =?iso-8859-1?Q?M=E4kel=E4?= , Coletta =?iso-8859-1?Q?R=E9mi?= From: Chris Hecker Subject: Re: [Caml-list] # eval line; (?) Cc: caml-list@inria.fr In-Reply-To: <3CDACC83.563B15A1@utu.fi> References: <20020509155828.4015de6d.remi.coletta@free.fr> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii"; format=flowed Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk > Try: >let eval str = > Toploop.execute_phrase true Format.std_formatter > (!Toploop.parse_toplevel_phrase (Lexing.from_string str));; I think he wants the variable to be bound into the current toplevel environment, which this doesn't do: # b;; Characters 0-1: Unbound value b # let eval str = Toploop.execute_phrase true Format.std_formatter (!Toploop.parse_toplevel_phrase (Lexing.from_string str));; val eval : string -> bool = # eval "let b = 1;;";; val b : int = 1 - : bool = true # b;; Characters 0-1: Unbound value b # eval "b;;";; Uncaught exception: Typecore.Error(_, _). Unless I made a mistaken assumption? I don't think there's any way to bind it into the current toplevel, but maybe you could dynamically load a module or hack something with #use or something. I'm using 3.01 still, so maybe this is different on 3.04. Chris ------------------- 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