Version française
Home     About     Download     Resources     Contact us    

This site is updated infrequently. For up-to-date information, please visit the new OCaml website at

Browse thread
RE: [Caml-list] Deep copy
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Alessandro Baretta <alex@b...>
Subject: Re: [Caml-list] Deep copy
Eray Ozkural wrote:
 > An equivalent of C++'s copy constructor would be
 > required. Can this be done without going "inside" the
 > ocaml system? :)

Please, leave copy constructors alone. They are among the
most hideous enemies of an OO programmer. The copy 
constructor always has very delicate interactions with 
assignment and function invocation, and since one often 
needs to redefine the copy constructor, for example to get 
deep copies as opposed to shallow copies, it is a serious 
source of bugs.

O'Caml has a neat OO system, with a single constructor and 
no destructors. I don't think it needs to borrow many ideas 
from C++.


To unsubscribe, mail Archives:
Bug reports: FAQ:
Beginner's list: