From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on yquem.inria.fr X-Spam-Level: X-Spam-Status: No, score=0.1 required=5.0 tests=AWL autolearn=disabled version=3.1.3 X-Original-To: caml-list@yquem.inria.fr Delivered-To: caml-list@yquem.inria.fr Received: from mail3-relais-sop.national.inria.fr (mail3-relais-sop.national.inria.fr [192.134.164.104]) by yquem.inria.fr (Postfix) with ESMTP id 0508BBBAF for ; Fri, 13 Mar 2009 05:54:21 +0100 (CET) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: ApoEAMeDuUnOe3NG/2dsb2JhbADPPYN+Bg X-IronPort-AV: E=Sophos;i="4.38,355,1233529200"; d="scan'208";a="24261942" Received: from spoomusic.com ([206.123.115.70]) by mail3-smtp-sop.national.inria.fr with ESMTP/TLS/DHE-RSA-AES256-SHA; 13 Mar 2009 05:54:21 +0100 Received: (qmail 20953 invoked by uid 89); 13 Mar 2009 04:54:19 -0000 Received: from unknown (HELO ?192.168.1.99?) (98.165.129.233) by 0 with ESMTPS (DHE-RSA-AES256-SHA encrypted); 13 Mar 2009 04:54:19 -0000 Message-ID: <49B9E6E7.5040109@ramenlabs.com> Date: Thu, 12 Mar 2009 21:53:59 -0700 From: Dave Benjamin User-Agent: Mozilla-Thunderbird 2.0.0.19 (X11/20090103) MIME-Version: 1.0 To: Roland Zumkeller Cc: caml-list@yquem.inria.fr Subject: Re: [Caml-list] Toploop.setvalue References: In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Spam: no; 0.00; toploop:01 toploop:01 val:01 initialized:01 ocaml:01 sourceforge:01 unbound:01 wrote:01 caml-list:01 int:01 int:01 benjamin:01 strings:01 unit:03 let:03 Roland Zumkeller wrote: > Hi, > > Can Toploop.setvalue be used to bind a value to an identifier, as does "let"? > > # Toploop.setvalue "b" (Obj.repr 43);; > - : unit = () > # b;; > Unbound value b > > I only got the other direction to work: > > # let a = 42;; > val a : int = 42 > # (Obj.obj (Toploop.getvalue "a") : int);; > - : int = 42 Not that I know of. I was only able to get it to rebind values that I initialized by evaluating expressions like "let b = 43;;". Here's an example: http://pleac.sourceforge.net/pleac_ocaml/strings.html#AEN68 Hope this helps - and if anyone has better advice I'd love to hear it, Dave