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 SAA06760; Fri, 14 May 2004 18:30:29 +0200 (MET DST) X-Authentication-Warning: pauillac.inria.fr: majordomo set sender to owner-caml-list@pauillac.inria.fr using -f Received: from nez-perce.inria.fr (nez-perce.inria.fr [192.93.2.78]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id SAA06196 for ; Fri, 14 May 2004 18:30:27 +0200 (MET DST) Received: from ms-smtp-01-eri0.ohiordc.rr.com (ms-smtp-01-smtplb.ohiordc.rr.com [65.24.5.135]) by nez-perce.inria.fr (8.12.10/8.12.10) with ESMTP id i4EGUQEV030043 for ; Fri, 14 May 2004 18:30:26 +0200 Received: from vilya (dhcp065-024-145-008.columbus.rr.com [65.24.145.8]) by ms-smtp-01-eri0.ohiordc.rr.com (8.12.10/8.12.7) with ESMTP id i4EGUMUK027896; Fri, 14 May 2004 12:30:23 -0400 (EDT) Received: from peuter ([192.168.2.2] ident=mail) by vilya with esmtp (Exim 3.36 #1 (Debian)) id 1BOfZm-0006LM-00; Fri, 14 May 2004 12:30:22 -0400 Received: from andrewl by peuter with local (Exim 3.36 #1 (Debian)) id 1BOfZm-0001NG-00; Fri, 14 May 2004 12:30:22 -0400 Date: Fri, 14 May 2004 12:30:22 -0400 From: Andrew Lenharth To: David Fox Cc: Ocaml Subject: Re: [Caml-list] "changing" immutable record elements Message-ID: <20040514163022.GA5274@peuter> References: <40A4EAC8.2080905@lindows.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <40A4EAC8.2080905@lindows.com> User-Agent: Mutt/1.5.5.1+cvs20040105i X-Virus-Scanned: Symantec AntiVirus Scan Engine X-Miltered: at nez-perce with ID 40A4F422.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Loop: caml-list@inria.fr X-Spam: no; 0.00; caml-list:01 immutable:01 2004:99 prettier:01 bug:01 faq:01 faq:01 beginner's:01 beginners:01 bin:01 caml-bugs:01 ocaml:01 caml:01 caml:01 0700,:01 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk let set_field3 r value = {r with field3=falue} Have fun Andrew Lenharth On Fri, May 14, 2004 at 08:50:32AM -0700, David Fox wrote: > Unless I am missing some core language feature, it seems to me that the > most awkward part of the language is constructing an expression that > represents a record with a single field modified: > > let set_field3 rec value = > match rec with > {field1=field1; field2=field2; field3=field3; field4=field4; > field5=field5} -> > {field1=field1; field2=field2; field3=value; field4=field4; > field5=field5} > > is there any prettier way of doing this? > > > ------------------- > 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 -- "It will work in practice, yes. But will it work in theory?" --- a french diplomat's comment, recalled by Madeleine Albright ------------------- 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