Message-Id: <199804251226.OAA01300@lama-d132.univ-savoie.fr>
To: Donald Syme <Donald.Syme@cl.cam.ac.uk>
Subject: Re: Non-destructive record update??
Date: Sat, 25 Apr 1998 14:26:43 +0300
From: Christophe Raffalli <craff@lama-d132.univ-savoie.fr>
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=
opy
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.
URL: http://www.logique.jussieu.fr/www.raffalli
email: Christophe.Raffalli@univ-savoie.fr
This archive was generated by hypermail 2b29 : Sun Jan 02 2000 - 11:58:14 MET