From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Original-To: caml-list@yquem.inria.fr Delivered-To: caml-list@yquem.inria.fr Received: from concorde.inria.fr (concorde.inria.fr [192.93.2.39]) by yquem.inria.fr (Postfix) with ESMTP id AD11FBB81 for ; Mon, 26 Sep 2005 23:07:30 +0200 (CEST) Received: from web26803.mail.ukl.yahoo.com (web26803.mail.ukl.yahoo.com [217.146.176.79]) by concorde.inria.fr (8.13.0/8.13.0) with SMTP id j8QL7UDq011950 for ; Mon, 26 Sep 2005 23:07:30 +0200 Received: (qmail 55852 invoked by uid 60001); 26 Sep 2005 21:07:30 -0000 DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.de; h=Message-ID:Received:Date:From:Subject:To:Cc:In-Reply-To:MIME-Version:Content-Type:Content-Transfer-Encoding; b=Rlqs+fk0+TeCGFhAb8RpDfrTjLW+Yarm+HFNPnklnEabQlnihM0I+B6fkhXxq0i06d7AAQ0lWtQhL9DNl+oR+X0tQe1b4eqA4tHg8cCtFnhfq02lvENo2uV9eWLrsCRsf/ANtUmn47aSVLSsSjgVPSXx3lxcc3iwiosyXqkrRTE= ; Message-ID: <20050926210730.55850.qmail@web26803.mail.ukl.yahoo.com> Received: from [213.103.152.126] by web26803.mail.ukl.yahoo.com via HTTP; Mon, 26 Sep 2005 23:07:30 CEST Date: Mon, 26 Sep 2005 23:07:30 +0200 (CEST) From: Martin Chabr Subject: Ant: Re: [Caml-list] Avoiding shared data To: William Lovas Cc: caml-list@yquem.inria.fr In-Reply-To: <20050926081727.GA9114@coruscant.stwing.upenn.edu> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-Miltered: at concorde with ID 43386312.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Spam: no; 0.00; caml-list:01 avoiding:01 mutable:01 recursion:01 ocaml:01 lovas:01 wlovas:01 stwing:01 upenn:01 mutable:01 25,:98 ...:98 ...:98 gesendet:98 jetzt:98 X-Spam-Checker-Version: SpamAssassin 3.0.3 (2005-04-27) on yquem.inria.fr X-Spam-Level: X-Spam-Status: No, score=0.4 required=5.0 tests=DNS_FROM_RFC_ABUSE autolearn=disabled version=3.0.3 Hello William, I am using a mutable record. I am programming this 90% in the imperative (non-functional) style, so that I can rewrite critical parts into Fortran easily. Another reason is, I am an intermediate user and finding out whether the recursion is a tail-one or not is difficult for me. This is a kind of number crunching problem and the data structures will be huge. Blessed are the creators of OCaml for the inclusion of all imperative constructs. Martin --- William Lovas schrieb: > 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 > Martin Chabr Hochstrasse 28 8044 Zürich Schweiz / Switzerland Tel.P.: 01-261 17 24 ___________________________________________________________ Gesendet von Yahoo! Mail - Jetzt mit 1GB Speicher kostenlos - Hier anmelden: http://mail.yahoo.de