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 7A339BB81 for ; Mon, 26 Sep 2005 10:17:31 +0200 (CEST) Received: from yavin.stwing.upenn.edu (YAVIN.STWING.upenn.edu [165.123.132.64]) by concorde.inria.fr (8.13.0/8.13.0) with ESMTP id j8Q8HU2V018429 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=FAIL) for ; Mon, 26 Sep 2005 10:17:31 +0200 Received: from localhost (localhost [127.0.0.1]) by yavin.stwing.upenn.edu (Postfix) with ESMTP id 9BBAA1032; Mon, 26 Sep 2005 04:17:29 -0400 (EDT) Received: from yavin.stwing.upenn.edu ([127.0.0.1]) by localhost (yavin.stwing.upenn.edu [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 26396-01; Mon, 26 Sep 2005 04:17:29 -0400 (EDT) Received: from coruscant.stwing.upenn.edu (coruscant.stwing.upenn.edu [165.123.132.62]) by yavin.stwing.upenn.edu (Postfix) with ESMTP id 4D2EBD10; Mon, 26 Sep 2005 04:17:29 -0400 (EDT) Received: by coruscant.stwing.upenn.edu (Postfix, from userid 5302) id 01B3DE51E; Mon, 26 Sep 2005 04:17:28 -0400 (EDT) Date: Mon, 26 Sep 2005 04:17:28 -0400 From: William Lovas To: caml-list@yquem.inria.fr Cc: Martin Chabr Subject: Re: [Caml-list] Avoiding shared data Message-ID: <20050926081727.GA9114@coruscant.stwing.upenn.edu> Mail-Followup-To: caml-list@yquem.inria.fr, Martin Chabr References: <20050925213202.32862.qmail@web26805.mail.ukl.yahoo.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20050925213202.32862.qmail@web26805.mail.ukl.yahoo.com> User-Agent: Mutt/1.5.6i X-Virus-Scanned: amavisd-new at stwing.upenn.edu X-Miltered: at concorde with ID 4337AE9A.001 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Spam: no; 0.00; lovas:01 wlovas:01 stwing:01 upenn:01 caml-list:01 avoiding:01 mutable:01 25,:98 ...:98 ...:98 wrote:01 structures:01 structures:01 int:01 data:02 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=none autolearn=disabled version=3.0.3 Hi Martin, On Sun, Sep 25, 2005 at 11:32:02PM +0200, Martin Chabr wrote: > [...] But I cannot use the same scheme to the > array of the (int * record) structures, because I do > not know how to copy these structures to dissolve the > sharing. I do not even know how to copy records. > [...] How can I produce completely > unshared structures? Maybe i'm missing something, but if these are unmutable records, then why do you need to concern yourself with any potential sharing? As long as the array cells are not "shared" -- which they can't be, as far as i know -- you can update each one individually no matter what the sharing status of their contents is. If the records *are* mutable, then the suggestion to use Array.init should be sufficient. Hoping i might save you some work :) William