From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from concorde.inria.fr (concorde.inria.fr [192.93.2.39]) by yquem.inria.fr (Postfix) with ESMTP id A989ABB9C for ; Wed, 21 Dec 2005 07:13:57 +0100 (CET) Received: from pauillac.inria.fr (pauillac.inria.fr [128.93.11.35]) by concorde.inria.fr (8.13.0/8.13.0) with ESMTP id jBL6DvPA008749 for ; Wed, 21 Dec 2005 07:13:57 +0100 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 HAA04333 for ; Wed, 21 Dec 2005 07:13:56 +0100 (MET) Received: from zproxy.gmail.com (zproxy.gmail.com [64.233.162.197]) by nez-perce.inria.fr (8.13.0/8.13.0) with ESMTP id jBL6Dt4Q021641 for ; Wed, 21 Dec 2005 07:13:56 +0100 Received: by zproxy.gmail.com with SMTP id 40so69284nzk for ; Tue, 20 Dec 2005 22:13:55 -0800 (PST) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=ELIChLmHhUE+pWrKWLFkIWSUKAKxoTyhufcGyn4R+I6n7CM7zpIH2FrfjTSMBSK6AJn/uBlbZzONqkTRmOkVKEEzWY+hoSxqD5I2CD8w/71YdVhq0BNRbTPn6TaL17YattB8a2JK6EHZTWbqz1AIyn0g9xz40bsts53TyXFfnTo= Received: by 10.65.121.8 with SMTP id y8mr237842qbm; Tue, 20 Dec 2005 22:13:55 -0800 (PST) Received: by 10.65.113.18 with HTTP; Tue, 20 Dec 2005 22:13:55 -0800 (PST) Message-ID: Date: Tue, 20 Dec 2005 23:13:55 -0700 From: Mackenzie Straight To: skaller Subject: Re: [Caml-list] syntax bug: copying records Cc: caml-list@inria.fr In-Reply-To: <1135142554.18811.16.camel@rosella> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline References: <1135142554.18811.16.camel@rosella> X-Miltered: at concorde with ID 43A8F2A5.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Miltered: at nez-perce with ID 43A8F2A3.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Spam: no; 0.00; caml-list:01 syntax:01 bug:01 dup:01 wrote:01 sourceforge:01 workaround:01 let:03 perhaps:03 ugly:03 repr:04 gmail:09 obj:11 obj:11 doesn't:12 X-Spam-Checker-Version: SpamAssassin 3.0.3 (2005-04-27) on yquem.inria.fr X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=RCVD_BY_IP autolearn=disabled version=3.0.3 On 12/20/05, skaller wrote: > If x is a record then { x } should be a copy of it. But this > doesn't work, I am using this ugly workaround instead: > > { x with dummy_field =3D x.dummy_field } > > Surely there is a better way? Perhaps: let copy (x:'a) =3D (Obj.obj (Obj.dup (Obj.repr x)) : 'a)