Version française
Home     About     Download     Resources     Contact us    
Browse thread
Avoiding shared data
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: William Lovas <wlovas@s...>
Subject: Re: [Caml-list] Avoiding shared data
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