caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* [Caml-list] Safe Obj.dup?
@ 2003-08-06 20:02 David Brown
  2003-08-06 20:34 ` Michal Moskal
  0 siblings, 1 reply; 2+ messages in thread
From: David Brown @ 2003-08-06 20:02 UTC (permalink / raw)
  To: Caml List

Is there an officially safe way of doing an Obj.dup?  I have a record
type with mutable fields, and I'd like to be able to make a copy of it.

Thanks,
Dave Brown

-------------------
To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr
Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners


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

* Re: [Caml-list] Safe Obj.dup?
  2003-08-06 20:02 [Caml-list] Safe Obj.dup? David Brown
@ 2003-08-06 20:34 ` Michal Moskal
  0 siblings, 0 replies; 2+ messages in thread
From: Michal Moskal @ 2003-08-06 20:34 UTC (permalink / raw)
  To: Caml List

On Wed, Aug 06, 2003 at 01:02:51PM -0700, David Brown wrote:
> Is there an officially safe way of doing an Obj.dup?  I have a record
> type with mutable fields, and I'd like to be able to make a copy of it.

let r = {x = 3; y = 7} in
let copy = {r with x = r.x}

You cannot say {r with } although I don't see any reason why.

-- 
: Michal Moskal :: http://www.kernel.pl/~malekith : GCS {C,UL}++++$ a? !tv
: When in doubt, use brute force. -- Ken Thompson : {E-,w}-- {b++,e}>+++ h

-------------------
To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr
Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners


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

end of thread, other threads:[~2003-08-06 20:36 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-08-06 20:02 [Caml-list] Safe Obj.dup? David Brown
2003-08-06 20:34 ` Michal Moskal

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