caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Alessandro Baretta <alex@baretta.com>
To: Ocaml <caml-list@inria.fr>
Subject: Re: [Caml-list] Deep copy
Date: Mon, 15 Jul 2002 20:18:40 +0200	[thread overview]
Message-ID: <3D331200.4070401@baretta.com> (raw)
In-Reply-To: <200207151824.30541.erayo@cs.bilkent.edu.tr>

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

Alex

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


  reply	other threads:[~2002-07-15 18:11 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-07-15 15:24 zze-MARCHEGAY Michael stagiaire FTRD/DTL/LAN
2002-07-15 15:24 ` Eray Ozkural
2002-07-15 18:18   ` Alessandro Baretta [this message]
2002-07-15 19:53 ` Alessandro Baretta
2002-07-15 22:35   ` John Prevost
2002-07-15 23:03     ` Alessandro Baretta
2002-07-16  8:19       ` John Prevost
  -- strict thread matches above, loose matches on Subject: below --
2002-07-15 10:06 zze-MARCHEGAY Michael stagiaire FTRD/DTL/LAN
2002-07-15 13:42 ` Ken Wakita
2002-07-15 14:43   ` Eray Ozkural
2002-07-15 15:33     ` Ken Wakita
2002-07-15 23:09   ` Ken Wakita
2002-07-15 15:02 ` Eray Ozkural
2002-07-15 15:27   ` Nicolas Cannasse
2002-07-15 15:40     ` Eray Ozkural
2002-07-15 16:22 ` sebastien FURIC

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=3D331200.4070401@baretta.com \
    --to=alex@baretta.com \
    --cc=caml-list@inria.fr \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).