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 |
I apology that I sent a silly code fragment last night. I included two
mistakes.
Small one: the order of arguments to to_string was wrong. it should be:
Marshal.from_string (Marshal.to_string obj [Marshal.Closures]) 0
Worse one: it does not work for OO features (sigh).
Sorry for disturbance.
Ken
> From: Ken Wakita <wakita@is.titech.ac.jp>
> Date: Mon, 15 Jul 2002 22:42:49 +0900
> To: zze-MARCHEGAY Michael stagiaire FTRD/DTL/LAN
> <michael.marchegay@rd.francetelecom.com>, caml-list <caml-list@inria.fr>
> 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
-------------------
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