Re: Non-destructive record update??

From: Christophe Raffalli (
Date: Sat Apr 25 1998 - 13:26:43 MET DST

Message-Id: <>
To: Donald Syme <>
Subject: Re: Non-destructive record update??
Date: Sat, 25 Apr 1998 14:26:43 +0300
From: Christophe Raffalli <>

I completely agree with that.

You can end up with a messy program when you want to update record in a =

functional way. Moreover, if you add one field to a record type you have =
to =

modify your program for each updating even if they are unrelated with the=
 new =

field !

The syntax could be

* x.y <- 2 (may be confusing with mutable syntax ?)

* let y = 2 in record x =

Or anything else, but there really should be something !

With the second syntax it is easy to extend the parser, =

and you could have a "and" to update more than one field, with only one c=
of the original record:

    let y = 2 and z = 3 in record x

 This is not the case with the straight forward compilation of:

    (x.y <- 2).z <- 3

-- =

Christophe Raffalli
Laboratoire de Mathématique / LAMA
Université de Savoie
UFR SFA, Campus Scientifique
73376, Le Bourget du Lac CEDEX, FRANCE.


This archive was generated by hypermail 2b29 : Sun Jan 02 2000 - 11:58:14 MET