caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Matt Gushee <mgushee@havenrock.com>
To: caml-list@pauillac.inria.fr
Subject: Re: [Caml-list] help
Date: Sun, 25 Apr 2004 11:39:27 -0600	[thread overview]
Message-ID: <20040425173927.GB973@swordfish> (raw)
In-Reply-To: <200404251806.23130.jdh30@cam.ac.uk>

On Sun, Apr 25, 2004 at 06:06:23PM +0100, Jon Harrop wrote:
> On Sunday 25 April 2004 5:30 pm, mohammad siddiqui wrote:
> > I tried exactly what you have told. Its is fine when we just have one
> > element in an array of words. If we have more than one, changing the value
> > of one changes the values of the rest of the elements.
> 
> Sorry, yes. Now I come to think of it, it's kind of obvious that a mutable 
> field in a record would also get copied.

Yes, a mutable field *or* a ref (which invalidates one of the solutions
I suggested). Actually, a ref is just a predefined record type that has a 
mutable field and is supported with a special assignment operator.

  # let wnum = { contents = 0 };;
  val wnum : int ref = {contents = 0}

-- 
Matt Gushee                 When a nation follows the Way,
Englewood, Colorado, USA    Horses bear manure through
mgushee@havenrock.com           its fields;
http://www.havenrock.com/   When a nation ignores the Way,
                            Horses bear soldiers through
                                its streets.
                                
                            --Lao Tzu (Peter Merel, trans.)

-------------------
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:[~2004-04-25 17:39 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-04-25 16:30 mohammad siddiqui
2004-04-25  1:53 ` mohammad siddiqui
2004-04-25 12:13   ` Jon Harrop
2004-04-25 12:45     ` Henri DF
2004-04-26 19:13       ` Jon Harrop
2004-04-26 22:38         ` Andrew Lenharth
2004-04-25 16:44   ` [Caml-list] help Brian Hurt
2004-04-25 17:28   ` [Caml-list] help Matt Gushee
2004-04-25 17:06 ` Jon Harrop
2004-04-25 17:39   ` Matt Gushee [this message]
2004-04-26  0:45 ` skaller
  -- strict thread matches above, loose matches on Subject: below --
2004-04-23  2:31 mohammad siddiqui
2004-04-23  4:17 ` Jon Harrop
2004-04-23  6:52   ` Jean-Christophe Filliatre
2004-04-23 15:43 ` Brian Hurt
2004-04-22 23:34 mohammad siddiqui
2004-04-22 23:57 ` Karl Zilles
2004-04-16 18:04 mohammad siddiqui
2004-04-16 18:59 ` skaller
2004-04-17  0:34   ` Shawn Wagner
2004-04-08 22:57 mohammad siddiqui
2004-04-09  6:56 ` Basile STARYNKEVITCH
2004-04-09  9:04 ` Richard Jones
2002-11-05 12:22 ÀîÒÇ
2002-11-05 13:39 ` Alessandro Baretta

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=20040425173927.GB973@swordfish \
    --to=mgushee@havenrock.com \
    --cc=caml-list@pauillac.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).