From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (from weis@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id LAA21573 for caml-redistribution; Wed, 15 Apr 1998 11:14:12 +0200 (MET DST) 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 BAA16815 for ; Wed, 15 Apr 1998 01:27:29 +0200 (MET DST) Received: from heaton.cl.cam.ac.uk (exim@heaton.cl.cam.ac.uk [128.232.32.11]) by concorde.inria.fr (8.8.7/8.8.5) with SMTP id BAA23505 for ; Wed, 15 Apr 1998 01:27:28 +0200 (MET DST) Received: from albatross.cl.cam.ac.uk (cl.cam.ac.uk) [128.232.0.96] by heaton.cl.cam.ac.uk with esmtp (Exim 1.82 #1) id 0yPF6q-00084I-00; Wed, 15 Apr 1998 00:27:24 +0100 X-Mailer: exmh version 2.0gamma+CL 97/01/24 To: caml-list@pauillac.inria.fr Subject: Non-destructive record update?? In-reply-to: Your message of "Thu, 09 Apr 1998 17:02:05 +0200." <199804091502.RAA14646@pauillac.inria.fr> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Wed, 15 Apr 1998 00:27:20 +0100 From: Donald Syme Message-Id: Sender: weis [Sorry - wrong subject on previous message] I think O'Caml is absolutely excellent in general, but why doesn't it have some form of non-destructive record field update, as in type x = {y : int};; let x = {y=1};; (x.y <- 2).y = 2;; (* true *) x.y = 1;; (* true *) ???? (well, at least I haven't found it if it does...) If I have N fields in my records, and if I need non-destructive update because I'm actually writing things functionally (rather common in a functional language), then I end up writing N*N lines worth of non-destructive update functions myself - yeach! Thanks in advance, Don Syme -- ----------------------------------------------------------------------------- At the lab: At home: The Computer Laboratory Trinity Hall New Museums Site CB2 1TJ University of Cambridge Cambridge, UK CB2 3QG, Cambridge, UK Ph: +44 (0) 1223 334688 http://www.cl.cam.ac.uk/users/drs1004/ email: drs1004@cl.cam.ac.uk -----------------------------------------------------------------------------