From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (from majordomo@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id RAA15673; Mon, 15 Jul 2002 17:08:42 +0200 (MET DST) X-Authentication-Warning: pauillac.inria.fr: majordomo set sender to owner-caml-list@pauillac.inria.fr using -f Received: from concorde.inria.fr (concorde.inria.fr [192.93.2.39]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id RAA15676 for ; Mon, 15 Jul 2002 17:08:41 +0200 (MET DST) Received: from mail.interaktif.net.tr ([62.248.102.120]) by concorde.inria.fr (8.11.1/8.11.1) with ESMTP id g6FF8ej28998 for ; Mon, 15 Jul 2002 17:08:40 +0200 (MET DST) Received: from abn166-176.ank-avrupa-ports.kablonet.net.tr (unknown [195.174.166.176]) by mail.interaktif.net.tr (Postfix) with ESMTP id 11B551E727; Mon, 15 Jul 2002 18:06:59 +0300 (EEST) From: Eray Ozkural Organization: Bilkent University CS Dept. To: "zze-MARCHEGAY Michael stagiaire FTRD/DTL/LAN" , Subject: Re: [Caml-list] Deep copy Date: Mon, 15 Jul 2002 18:02:44 +0300 User-Agent: KMail/1.4.5 References: <0489A7888F080B4BA73B53F7E145F29A1B0AF3@LANMHS20.rd.francetelecom.fr> In-Reply-To: <0489A7888F080B4BA73B53F7E145F29A1B0AF3@LANMHS20.rd.francetelecom.fr> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 8bit Content-Disposition: inline Message-Id: <200207151802.44699.erayo@cs.bilkent.edu.tr> Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk On Monday 15 July 2002 13:06, zze-MARCHEGAY Michael stagiaire FTRD/DTL/LAN wrote: > 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. You mean something like creating a new object on the heap and copying over the contents of an existing object. If this were C++ all you had to do would be invoking the copy constructor Node* x = new Node(old_node); >>From the documentation OO.copy does look like a deep copy operation: val copy : < .. > -> < .. > Oo.copy o returns a copy of object o, that is a fresh object with the same methods and instance variables as o Curious, -- Eray Ozkural Comp. Sci. Dept., Bilkent University, Ankara www: http://www.cs.bilkent.edu.tr/~erayo GPG public key fingerprint: 360C 852F 88B0 A745 F31B EA0F 7C07 AE16 874D 539C ------------------- 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