Browse thread
[Caml-list] Deep copy
[
Home
]
[ Index:
by date
|
by threads
]
[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
| Date: | -- (:) |
| From: | Ken Wakita <wakita@i...> |
| Subject: | Re: [Caml-list] Deep copy |
How about the following? Marshal.from_string (Marshal.to_string [Marshal.Closures] obj) 0 Ken Wakita > From: "zze-MARCHEGAY Michael stagiaire FTRD/DTL/LAN" > <michael.marchegay@rd.francetelecom.com> > Date: Mon, 15 Jul 2002 12:06:58 +0200 > To: <caml-list@inria.fr> > Subject: [Caml-list] Deep copy > > Hi all, > > I'm writting a program that manipulates a graph structure and I need to make > deep copies of some of the graph nodes. The function Oo.copy donesn't perform > a deep copy and I haven't found any other that could make it. > > Actually, the nodes of my graph are specified using a lot inheritance, and if > I want to write specific "copy" methods for them, I will need to disperse the > clonning actions downto the leaf of my inheritance tree. > > So I'd like to know is there is a clean way to make a deep copy of any object. > > Thank you. > > -- > Michaël Marchegay, Stagiaire France Telecom R&D du 11/02/2002 au 26/07/2002 > Sous la responsabilité d'Olivier Dubuisson > DTL/TAL - 22307 Lannion Cedex - France > ------------------- > 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 ------------------- 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