caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* initialization of arrays
@ 1997-04-29 20:08 David Monniaux
  1997-05-05 17:06 ` Pierre Weis
  1997-05-06 11:43 ` Christophe Raffalli
  0 siblings, 2 replies; 3+ messages in thread
From: David Monniaux @ 1997-04-29 20:08 UTC (permalink / raw)
  To: Caml-list

[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.






^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~1997-05-06 12:41 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1997-04-29 20:08 initialization of arrays David Monniaux
1997-05-05 17:06 ` Pierre Weis
1997-05-06 11:43 ` Christophe Raffalli

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).