Mailing list for all users of the OCaml language and system.
 help / color / mirror / Atom feed
From: Christophe Raffalli <craff@lama-d132.univ-savoie.fr>
To: Donald Syme <Donald.Syme@cl.cam.ac.uk>
Cc: caml-list@pauillac.inria.fr
Subject: Re: Non-destructive record update??
Date: Sat, 25 Apr 1998 14:26:43 +0300	[thread overview]
Message-ID: <199804251226.OAA01300@lama-d132.univ-savoie.fr> (raw)
In-Reply-To: Your message of "Wed, 15 Apr 1998 00:27:20 BST." <E0yPF6q-00084I-00@heaton.cl.cam.ac.uk>


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 copy
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






  reply	other threads:[~1998-04-16 14:20 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1998-04-09 15:02 Caml sur Rhapsody Pierre Weis
1998-04-14 23:27 ` Non-destructive record update?? Donald Syme
1998-04-25 11:26   ` Christophe Raffalli [this message]
1998-04-16 14:19     ` Pierre Weis
1998-04-16 14:47       ` Pascal Brisset
1998-04-17  0:26       ` Jacques GARRIGUE

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=199804251226.OAA01300@lama-d132.univ-savoie.fr \
    --to=craff@lama-d132.univ-savoie.fr \
    --cc=Christophe.Raffalli@univ-savoie.fr \
    --cc=Donald.Syme@cl.cam.ac.uk \
    --cc=caml-list@pauillac.inria.fr \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox