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 WAA29034; Fri, 23 May 2003 22:25:58 +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 WAA29020 for ; Fri, 23 May 2003 22:25:57 +0200 (MET DST) Received: from grace.speakeasy.org (grace.speakeasy.org [216.254.0.2]) by concorde.inria.fr (8.11.1/8.11.1) with SMTP id h4NKPtH25288 for ; Fri, 23 May 2003 22:25:56 +0200 (MET DST) Received: (qmail 2933 invoked by uid 36130); 23 May 2003 20:25:54 -0000 Received: from localhost (sendmail-bs@127.0.0.1) by localhost with SMTP; 23 May 2003 20:25:54 -0000 Date: Fri, 23 May 2003 13:25:54 -0700 (PDT) From: brogoff@speakeasy.net To: Brian Hurt cc: David Monniaux , hermanns , "caml-list@inria.fr" Subject: Re: [Caml-list] Why are arithmetic functions not polymorph? In-Reply-To: Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Spam: no; 0.00; brogoff:01 caml-list:01 abominable:01 haskell:01 gcaml:01 camlp:01 ocaml:01 speakeasy:01 overloading:01 arithmetic:01 handles:01 sml:01 conversions:02 implicit:02 overload:03 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk On Fri, 23 May 2003, Brian Hurt wrote: > On Fri, 23 May 2003 brogoff@speakeasy.net wrote: > > > > SML has a kind of operator overloading, but I don't know the details. > > > > SML doesn't allow the user to define overloadings, and that is an > > abomination. Java is similarly abominable. > > > > Ocaml allows you to define *new* operators to your heart's content. You > just can't overload the meanings of old operators. I understand the difference between operator redefinition, which OCaml and SML have, and user defined overloading, which neither has, but which can be found in Haskell and Clean (sort of, through type classes) and C++ and Ada. I actually think overloading can be *really* *really* good. The problem, or rather, one of the many problems, with C++ IMO is that it has overloading and implicit conversions of types. That's a bad combination. One nice thing about GCaml is that it shouldn't bother people like you who dislike overloading. The overloading is fairly explicit and closed world. It gracefully handles the most important, very simple cases, and sneaks in the ability to type a much wider range of functions than can be typed now. You should at least take a look at the README in the prototype to get an idea of what I mean here. New operators are not sufficient, and SML is more powerful in it's ability to define new operators than OCaml (minus CamlP4) is. -- Brian ------------------- 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