From: Jean-Marc Alliot <alliot@recherche.enac.fr>
Cc: caml-list@inria.fr
Subject: Re: Overloading again (Was Re: [Caml-list] Interfacing C++ and Ocaml)
Date: Mon, 02 Apr 2001 10:13:40 +0200 [thread overview]
Message-ID: <3AC834B4.559806D0@recherche.enac.fr> (raw)
In-Reply-To: <Pine.BSF.4.21.0103300834470.3298-100000@shell5.ba.best.com>
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
next prev parent reply other threads:[~2001-04-02 8:13 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2001-03-30 8:54 [Caml-list] Interfacing C++ and Ocaml David Chemouil
2001-03-30 9:13 ` Bruce Hoult
2001-03-30 9:24 ` Fergus Henderson
2001-03-30 16:50 ` Overloading again (Was Re: [Caml-list] Interfacing C++ and Ocaml) Brian Rogoff
2001-04-02 8:13 ` Jean-Marc Alliot [this message]
2001-04-02 13:48 ` Fergus Henderson
2001-04-02 14:30 ` Jean-Marc Alliot
2001-04-02 15:49 ` Brian Rogoff
2001-04-09 6:47 ` John Max Skaller
2001-04-02 15:51 ` Brock
2001-03-30 20:41 Hao-yang Wang
2001-04-01 20:15 ` Sven LUTHER
2001-04-02 11:07 ` Sven LUTHER
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=3AC834B4.559806D0@recherche.enac.fr \
--to=alliot@recherche.enac.fr \
--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