From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail3-relais-sop.national.inria.fr (mail3-relais-sop.national.inria.fr [192.134.164.104]) by walapai.inria.fr (8.13.6/8.13.6) with ESMTP id p42DOK13018164 for ; Mon, 2 May 2011 15:24:21 +0200 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AnAAAEWwvk2LEwExkWdsb2JhbACmHBQBAQEBCQsLBxQFILJ9AY0ZBYYAkxaKCw X-IronPort-AV: E=Sophos;i="4.64,302,1301868000"; d="scan'208";a="82163567" Received: from hera.mpi-sb.mpg.de ([139.19.1.49]) by mail3-smtp-sop.national.inria.fr with ESMTP/TLS/AES256-SHA; 02 May 2011 15:24:13 +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=LOgDPXCgM4sQflGjKUsvSf2nBvtUw2ivc8DEmuo XN/Y=; b=pWdZFwkA8D65NqDFAUVCasAktM1ukb4eF8gLg5VGKpw2+JcLFxY/2Z3 TUBn23LXkBUHJeJ+Kcxxuo7tO7Gv6lnixF2CE+ZLwyphkb8E1nueRPGwo5K3XrnM A9YtAYNxZyRcHCWjC98pVs6Ige5WBMGFqeRaqHOfurZxM9gFmeto= Received: from infao0525.mpi-klsb.mpg.de ([139.19.1.26]:44702 helo=maniac.mpi-klsb.mpg.de) by hera.mpi-sb.mpg.de (envelope-from ) with esmtp (Exim 4.69) id 1QGt6f-0004w1-SO; Mon, 02 May 2011 15:24:12 +0200 Received: from [74.125.122.49] (port=6576 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 1QGt6f-0007Kc-D5; Mon, 02 May 2011 15:24:09 +0200 From: Andreas Rossberg To: Create Software In-Reply-To: <4DBEAE90.9050506@users.sourceforge.net> References: <4DBEA464.7090102@users.sourceforge.net> <4DBEAE90.9050506@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 15:24:07 +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 15:16, Create Software wrote: >> Only the record field itself is mutable. Extracting only gives you >> a value, not a reference. > > Sure, but how come that > let reset {label = lbl} = lbl <- 0;; > works fine in Caml Light and not in OCaml? Same reason: pattern matching extracts the value. I can't tell why it worked in Caml Light, though, since I'm not familiar enough with it. /Andreas