caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Daniel de Rauglaudre <daniel.de_rauglaudre@inria.fr>
To: caml-list@inria.fr
Subject: Re: [Caml-list] Newbie question: semantics of 'mutable' in relation to deep / shallow copying of CAML values.
Date: Thu, 22 Nov 2001 14:11:06 +0100	[thread overview]
Message-ID: <20011122141106.K6496@verdot.inria.fr> (raw)
In-Reply-To: <11103C7901D5D411B45800508BB02D72012466E7@exchange1.sle.sharp.co.uk>; from gerard.murphy@sharp.co.uk on Thu, Nov 22, 2001 at 12:25:04PM -0000

On Thu, Nov 22, 2001 at 12:25:04PM -0000, Gerard Murphy wrote:

> Surprise! 'value2' is sharing state with 'value1', but neither
> 'value1' nor 'value2' are CAML references.

There is no specific notion of "reference" in OCaml: the type "ref" is
actually implemented as a mutable record:
   type 'a ref = { mutable contents : 'a }

 !x is just a shortcut for x.contents
  x := y is just a shortcut for x.contents <- y

-- 
Daniel de RAUGLAUDRE
daniel.de_rauglaudre@inria.fr
http://cristal.inria.fr/~ddr/
-------------------
Bug reports: http://caml.inria.fr/bin/caml-bugs  FAQ: http://caml.inria.fr/FAQ/
To unsubscribe, mail caml-list-request@inria.fr  Archives: http://caml.inria.fr


  reply	other threads:[~2001-11-22 13:11 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-11-22 12:25 Gerard Murphy
2001-11-22 13:11 ` Daniel de Rauglaudre [this message]
2001-11-22 14:23 ` Alain Frisch

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=20011122141106.K6496@verdot.inria.fr \
    --to=daniel.de_rauglaudre@inria.fr \
    --cc=caml-list@inria.fr \
    /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).