From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (from majordomo@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id TAA11977; Sun, 25 Apr 2004 19:39:30 +0200 (MET DST) X-Authentication-Warning: pauillac.inria.fr: majordomo set sender to owner-caml-list@pauillac.inria.fr using -f Received: from concorde.inria.fr (concorde.inria.fr [192.93.2.39]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id TAA12057 for ; Sun, 25 Apr 2004 19:39:29 +0200 (MET DST) Received: from mz3.forethought.net (mzpi5.forethought.net [216.241.36.14]) by concorde.inria.fr (8.12.10/8.12.10) with ESMTP id i3PHdRYM020472 for ; Sun, 25 Apr 2004 19:39:28 +0200 Received: from [216.241.35.41] (helo=swordfish) by mz3.forethought.net with esmtp (Exim 4.30) id 1BHnbC-00047B-OG for caml-list@pauillac.inria.fr; Sun, 25 Apr 2004 11:39:26 -0600 Received: from matt by swordfish with local (Exim 3.35 #1 (Debian)) id 1BHnbD-0001dT-00 for ; Sun, 25 Apr 2004 11:39:27 -0600 Date: Sun, 25 Apr 2004 11:39:27 -0600 From: Matt Gushee To: caml-list@pauillac.inria.fr Subject: Re: [Caml-list] help Message-ID: <20040425173927.GB973@swordfish> Reply-To: Matt Gushee Mail-Followup-To: caml-list@pauillac.inria.fr References: <200404251806.23130.jdh30@cam.ac.uk> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <200404251806.23130.jdh30@cam.ac.uk> User-Agent: Mutt/1.3.27i X-Miltered: at concorde by Joe's j-chkmail ("http://j-chkmail.ensmp.fr")! X-Loop: caml-list@inria.fr X-Spam: no; 0.00; gushee:01 mgushee:01 havenrock:01 caml-list:01 2004:99 2004:99 invalidates:01 val:01 gushee:01 englewood:01 manure:01 mgushee:01 havenrock:01 ignores:01 --lao:01 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk 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