English version
Accueil     À propos     Téléchargement     Ressources     Contactez-nous    

Ce site est rarement mis à jour. Pour les informations les plus récentes, rendez-vous sur le nouveau site OCaml à l'adresse ocaml.org.

Browse thread
Shallow copy of a record
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2005-01-22 (16:45)
From: Chris King <colanderman@g...>
Subject: Re: [Caml-list] Shallow copy of a record
On Sat, 22 Jan 2005 08:17:19 -0600, Kurt Welgehausen <kwel@kwel.net> wrote:

> It's not clear whether you require a general polymorphic
> copy function or you just need to make a copy of a
> particular record.

Just the particular record.

> In the latter case, something like
>   let y = {x with a = x.a}
> will do what you want (even though it's not very pretty).

Yeah, that's what I thought of first; I was just hoping there was a
way to do it without the redundant assign (like {x} or something).