From: David Monniaux <David.Monniaux@ens-lyon.fr>
To: Caml-list <caml-list@inria.fr>
Subject: initialization of arrays
Date: Tue, 29 Apr 1997 22:08:15 +0200 (MET DST) [thread overview]
Message-ID: <Pine.GSO.3.95.970429214123.25931A-100000@terreaux> (raw)
[en français: l'initialisation de tableaux n'est pas pratique pour les
types mutables...]
Hi,
creating an array initializes all the cells to the same physical content.
That is not very handy when the content is a mutable record. Of course,
one can initialize the cells with copies of a given record. There we run
into another problem: the only way I know of, given a record, produce
another record of the same content, is to write the following kind of
code:
{ field1=a.field1; field2=a.field2 ...}
This is quite cumbersome.
Wouldn't it be handy to have a function of type 'a->'a that duplicates
physically a piece of data, and functions that create vectors or
matrices with copy?
I feel it's now doable somehow with the Obj module (I'm testing it), but
using undocumented features is cumbersome and unsafe...
Thanks.
next reply other threads:[~1997-05-06 7:33 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
1997-04-29 20:08 David Monniaux [this message]
1997-05-05 17:06 ` Pierre Weis
1997-05-06 11:43 ` Christophe Raffalli
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=Pine.GSO.3.95.970429214123.25931A-100000@terreaux \
--to=david.monniaux@ens-lyon.fr \
--cc=caml-list@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