<?xml version="1.0" encoding="ISO-8859-1"?>

<!DOCTYPE message PUBLIC
  "-//MLarc//DTD MLarc output files//EN"
  "../../mlarc.dtd"[
  <!ATTLIST message
    listname CDATA #REQUIRED
    title CDATA #REQUIRED
  >
]>

  <?xml-stylesheet href="../../mlarc.xsl" type="text/xsl"?>


<message 
  url="2002/07/101f631797d254be4dac4a73b379b0ee"
  from="Alessandro Baretta &lt;alex@b...&gt;"
  author="Alessandro Baretta"
  date="2002-07-15T22:56:31"
  subject="Re: [Caml-list] Deep copy"
  prev="2002/07/15f5a5b0e7c6ba77a94ba8a6b6e1d150"
  next="2002/07/2fe55408b32aa0c8bbfe694c2fc4d83a"
  prev-in-thread="2002/07/15f5a5b0e7c6ba77a94ba8a6b6e1d150"
  next-in-thread="2002/07/f49c5a97e201b0f6ea5977beb5930c17"
  prev-thread="2002/07/a6ba0ce22f3d5db7ef94de3a44da9825"
  next-thread="2002/07/2fe55408b32aa0c8bbfe694c2fc4d83a"
  root="../../"
  period="month"
  listname="caml-list"
  title="Archives of the Caml mailing list">

<thread subject="RE: [Caml-list] Deep copy">
<msg 
  url="2002/07/f588263f2499215c76c4696e61086612"
  from="zze-MARCHEGAY Michael stagiaire FTRD/DTL/LAN &lt;michael.marchegay@r...&gt;"
  author="zze-MARCHEGAY Michael stagiaire FTRD/DTL/LAN"
  date="2002-07-15T15:24:59"
  subject="RE: [Caml-list] Deep copy">
<msg 
  url="2002/07/0908d34fdb197e026aad915879cf4cd2"
  from="Eray Ozkural &lt;erayo@c...&gt;"
  author="Eray Ozkural"
  date="2002-07-15T15:30:19"
  subject="Re: [Caml-list] Deep copy">
<msg 
  url="2002/07/72c2dc79654035cd9f28bd2d5e20f330"
  from="Alessandro Baretta &lt;alex@b...&gt;"
  author="Alessandro Baretta"
  date="2002-07-15T18:11:41"
  subject="Re: [Caml-list] Deep copy">
</msg>
</msg>
<msg 
  url="2002/07/e05cd085c84fab343d2798f03cabcf5e"
  from="Alessandro Baretta &lt;alex@b...&gt;"
  author="Alessandro Baretta"
  date="2002-07-15T19:46:53"
  subject="Re: [Caml-list] Deep copy">
<msg 
  url="2002/07/15f5a5b0e7c6ba77a94ba8a6b6e1d150"
  from="John Prevost &lt;j.prevost@c...&gt;"
  author="John Prevost"
  date="2002-07-15T22:28:33"
  subject="Re: [Caml-list] Deep copy">
<msg 
  url="2002/07/101f631797d254be4dac4a73b379b0ee"
  from="Alessandro Baretta &lt;alex@b...&gt;"
  author="Alessandro Baretta"
  date="2002-07-15T22:56:31"
  subject="Re: [Caml-list] Deep copy">
<msg 
  url="2002/07/f49c5a97e201b0f6ea5977beb5930c17"
  from="John Prevost &lt;j.prevost@c...&gt;"
  author="John Prevost"
  date="2002-07-16T08:13:08"
  subject="Re: [Caml-list] Deep copy">
</msg>
</msg>
</msg>
</msg>
</msg>
</thread>

<contents>


John Prevost wrote:
&gt;&gt;&gt;&gt;&gt;&gt;"ab" == Alessandro Baretta &lt;alex@baretta.com&gt; writes:
&gt;&gt;&gt;&gt;&gt;
&gt; 
&gt;     ab&gt; I agree so far. But did you actually test the code below? I
&gt;     ab&gt; have reason to believe you are mistaken in believing that
&gt;     ab&gt; mutable fields are shared between Oo.copied objects, in such a
&gt;     ab&gt; way that assignment to such a field in one object will result
&gt;     ab&gt; in a modification in the value of the same field in all
&gt;     ab&gt; copies. I would consider such a behavior a major design flaw
&gt;     ab&gt; in the language.
&gt; 
&gt; The code he gave is correct.  The problem arises not when the object
&gt; itself contains a mutable field, but when one of its fields contains a
&gt; mutable value.  (An object with a mutable field, a string, an array, a
&gt; record with a mutable field, a ref, etc.)
...
&gt; As far as I can tell, the poster to whom you are responding was simply
&gt; pointing this out: if a field contains a mutable value (whether the
&gt; field itself is mutable or not), the contents of that field are
&gt; copied, which results in physical equality of the field values in
&gt; those cases where physical identity is important.  He doesn't appear
&gt; to have claimed that the copied fields themselves have physical
&gt; equality.

Ah, yes! My mistake. I misread the previous post. I'm sorry 
for that. I'm coding too much and sleeping too little.

Alex

-------------------
To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr
Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners

</contents>

</message>

