caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Alessandro Baretta <alex@baretta.com>
To: John Prevost <j.prevost@cs.cmu.edu>
Cc: zze-MARCHEGAY Michael stagiaire FTRD/DTL/LAN
	<michael.marchegay@rd.francetelecom.com>,
	Ocaml <caml-list@inria.fr>
Subject: Re: [Caml-list] Deep copy
Date: Tue, 16 Jul 2002 01:03:28 +0200	[thread overview]
Message-ID: <3D3354C0.9040403@baretta.com> (raw)
In-Reply-To: <86sn2ksjq8.fsf@laurelin.dementia.org>



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


  reply	other threads:[~2002-07-15 22:56 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-07-15 15:24 zze-MARCHEGAY Michael stagiaire FTRD/DTL/LAN
2002-07-15 15:24 ` Eray Ozkural
2002-07-15 18:18   ` Alessandro Baretta
2002-07-15 19:53 ` Alessandro Baretta
2002-07-15 22:35   ` John Prevost
2002-07-15 23:03     ` Alessandro Baretta [this message]
2002-07-16  8:19       ` John Prevost
  -- strict thread matches above, loose matches on Subject: below --
2002-07-15 10:06 zze-MARCHEGAY Michael stagiaire FTRD/DTL/LAN
2002-07-15 13:42 ` Ken Wakita
2002-07-15 14:43   ` Eray Ozkural
2002-07-15 15:33     ` Ken Wakita
2002-07-15 23:09   ` Ken Wakita
2002-07-15 15:02 ` Eray Ozkural
2002-07-15 15:27   ` Nicolas Cannasse
2002-07-15 15:40     ` Eray Ozkural
2002-07-15 16:22 ` sebastien FURIC

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=3D3354C0.9040403@baretta.com \
    --to=alex@baretta.com \
    --cc=caml-list@inria.fr \
    --cc=j.prevost@cs.cmu.edu \
    --cc=michael.marchegay@rd.francetelecom.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).