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 KAA25751; Mon, 2 Apr 2001 10:13:48 +0200 (MET DST) X-Authentication-Warning: pauillac.inria.fr: majordomo set sender to owner-caml-list@pauillac.inria.fr using -f Received: from nez-perce.inria.fr (nez-perce.inria.fr [192.93.2.78]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id KAA25865 for ; Mon, 2 Apr 2001 10:13:48 +0200 (MET DST) Received: from indigo.recherche.enac.fr (indigo.recherche.enac.fr [195.220.158.66]) by nez-perce.inria.fr (8.11.1/8.10.0) with ESMTP id f328DkD06258 for ; Mon, 2 Apr 2001 10:13:47 +0200 (MET DST) Received: from rouge.recherche.enac.fr (mail@rouge.recherche.enac.fr [10.31.1.70] (may be forged)) by indigo.recherche.enac.fr (8.8.6 (PHNE_14041)/8.6.11) with ESMTP id KAA04281 for ; Mon, 2 Apr 2001 10:13:41 +0200 (METDST) Received: from localhost ([127.0.0.1] helo=recherche.enac.fr ident=alliot) by rouge.recherche.enac.fr with esmtp (Exim 3.12 #1 (Debian)) id 14jzT2-0006JS-00 for ; Mon, 02 Apr 2001 10:13:40 +0200 Message-ID: <3AC834B4.559806D0@recherche.enac.fr> Date: Mon, 02 Apr 2001 10:13:40 +0200 From: Jean-Marc Alliot X-Mailer: Mozilla 4.76 [en] (X11; U; Linux 2.4.0 i686) X-Accept-Language: fr, en MIME-Version: 1.0 CC: caml-list@inria.fr Subject: Re: Overloading again (Was Re: [Caml-list] Interfacing C++ and Ocaml) References: Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk Brian Rogoff wrote: > I'd also love to know if and when this will make it into Ocaml since this > is one of the few things that I dislike about ML style languages and > even after quite a bit of Caml programming I still miss overloading. > Well, I am going to be the black sheep again, but as an old ADA and C++ programmer, I don't really want to see overloading pop up in ML. Overloading can become easily a source of mistakes. My favorite example is the following. A few years ago, I was managing a project with C++ code, and one of the programmer was using a third party library (the author of this library was gone and had been replaced). And he had a bug inside the following code fragment in that library: toto(titi *initp) { titi *p; for (p=initp;p!=NULL;p++) { ....... } } And it took him a very long time to realize that the ++ operator had been overloaded, somewhere in a .h file included in an other .h file, and that instead of incrmenting the pointer, it was doing something like p=p->next, with a next field incorrectly initialized somewhere. Having different names for different functions is, according to me, an excellent thing. JMA ------------------- To unsubscribe, mail caml-list-request@inria.fr. Archives: http://caml.inria.fr