From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (from weis@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id JAA02568 for caml-redistribution; Wed, 11 Mar 1998 09:24:00 +0100 (MET) 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 WAA08419 for ; Tue, 10 Mar 1998 22:35:34 +0100 (MET) Received: from shell5.ba.best.com (bpr@shell5.ba.best.com [206.184.139.136]) by nez-perce.inria.fr (8.8.7/8.8.5) with ESMTP id WAA24201 for ; Tue, 10 Mar 1998 22:35:31 +0100 (MET) Received: from localhost (bpr@localhost) by shell5.ba.best.com (8.8.8/8.8.BEST) with SMTP id NAA07092 for ; Tue, 10 Mar 1998 13:35:30 -0800 (PST) Date: Tue, 10 Mar 1998 13:35:29 -0800 (PST) From: Brian Rogoff To: caml-list@inria.fr Subject: Re: Overloading In-Reply-To: <199803101942.OAA09854@wagga.cs.umass.edu> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: weis On Tue, 10 Mar 1998, Adam P. Jenkins wrote: > Brian Rogoff writes: > > Hi Caml'ers, > > One of the things I miss the most when I'm working in Caml is > > overloading. There are numerous situations, such as arithmetic, linear > > algebra (where I may want multiplication between scalars, vectors, > > matrices, and higher order tensors), I/O (read/write/open), etc. where > > it is IMO the "right thing". Are there any plans to add some form of > > overloading to Caml in the future? I know that the Haskell folks plan to > > remove the single parameter restriction in type classes and gain more > > expressiveness in these areas, but none of the ML family of languages > > I know of support any overloading. > > > > My experience with overloading in Ada is almost entirely positive. > > > > I too have missed overloading in ML/Caml. However, it seems to me > that function overloading is opposed to type inference; you can't have > both at the same time without too many explicit casts, which destroys > the point of function overloading. Yes, I know the marriage of the type inference and overloading is a difficult one. > Are there any languages which have > both automatic type inference and function overloading? > > Adam Haskell has some limited ad-hoc polymorphism via its type classes, and there was some work at adding a form of ad-hoc polymorphism to Caml. It is on the Caml page, look for "extensional" polymorphism. I haven't read it yet. Perhaps some of the Caml implementors can comment on what it describes. Also under Francois Rouaix's page is a description of "Alcool", which has another approach to overloading in an ML like language. C++ (which has overloading) supports a limited form of type inference for templated functions. There was a proposal to add something similar to Ada in an old Tri-Ada proceedings. It is usually called "automatic instantiation" or something similar in those communities. In response to Frank Christoph, I am using O'Caml. What I really want in this case is overloading, not OO. I think the reasons for this desire and the arguments for overloading are known, so I won't repeat them unless someone wants me to. I have seen O'Labl, but since I use Windows NT at home I haven't used it yet (when I get Linux that will change ;-). It looks very promising, and I also miss named parameters from Ada, but still, it isn't quite what I want. -- Brian