From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail1-relais-roc.national.inria.fr (mail1-relais-roc.national.inria.fr [192.134.164.82]) by walapai.inria.fr (8.13.6/8.13.6) with ESMTP id p42CiZOs015844 for ; Mon, 2 May 2011 14:44:35 +0200 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AnAAALKmvk2LEwExkWdsb2JhbACmHBQBAQEBCQsLBxQFILJ6AY0MBYYAkxaKCw X-IronPort-AV: E=Sophos;i="4.64,302,1301868000"; d="scan'208";a="107235753" Received: from hera.mpi-sb.mpg.de ([139.19.1.49]) by mail1-smtp-roc.national.inria.fr with ESMTP/TLS/AES256-SHA; 02 May 2011 14:44:29 +0200 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mpi-sb.mpg.de; s=mail200803; h=From:To:In-Reply-To:Subject: References:Message-Id:Content-Type:Content-Transfer-Encoding: Mime-Version:Date:Cc; bh=lIxMrpaiVFPRKGBDMiSifQlQW+2d7SajkPBWH3u UZXU=; b=vlqU9yY3ZUXIqMi7Gaeauo0mLzMlKsmU4hYAewXc8noFHJEZfWUsZT+ ezg4DiwLPAfMINw/KcqtDV4CUM7hkeqBRI0ld9qdUdUXASRG4RHtTDbHdpxrvqVk 5AUQuv+tM8UXpikpZqAC0GSuXFGGuR44NbcMveVeOShVp5dAjng0= Received: from infao0525.mpi-klsb.mpg.de ([139.19.1.26]:36035 helo=maniac.mpi-klsb.mpg.de) by hera.mpi-sb.mpg.de (envelope-from ) with esmtp (Exim 4.69) id 1QGsUE-00044Y-TN; Mon, 02 May 2011 14:44:28 +0200 Received: from [74.125.122.49] (port=22175 helo=[172.28.88.216]) by maniac.mpi-klsb.mpg.de (envelope-from ) with esmtpsa (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.69) id 1QGsUE-00074p-Df; Mon, 02 May 2011 14:44:26 +0200 From: Andreas Rossberg To: Create Software In-Reply-To: <4DBEA464.7090102@users.sourceforge.net> References: <4DBEA464.7090102@users.sourceforge.net> Message-Id: Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit Mime-Version: 1.0 (Apple Message framework v936) Date: Mon, 2 May 2011 14:44:23 +0200 Cc: caml-list@inria.fr X-Mailer: Apple Mail (2.936) Subject: Re: [Caml-list] Pattern-matching on Ocaml records On May 2, 2011, at 14:32, Create Software wrote: > PS: I also tried > > let reset' a = > let lbl = a.label in > lbl <- 0 > ;; > > but "The identifier lbl is not mutable.", in both OCaml and Caml > Light. Why so? Try: a.lbl <- 0 Only the record field itself is mutable. Extracting only gives you a value, not a reference. /Andreas