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 WAA13512; Sun, 1 Apr 2001 22:14:40 +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 WAA13514 for ; Sun, 1 Apr 2001 22:14:39 +0200 (MET DST) Received: from dpt-info.u-strasbg.fr (dpt-info.u-strasbg.fr [130.79.6.1]) by nez-perce.inria.fr (8.11.1/8.10.0) with ESMTP id f31KEcP23892 for ; Sun, 1 Apr 2001 22:14:38 +0200 (MET DST) Received: from lambda.u-strasbg.fr (lambda.u-strasbg.fr [130.79.90.63]) by dpt-info.u-strasbg.fr (8.9.3/8.9.3) with ESMTP id WAA31206; Sun, 1 Apr 2001 22:14:00 +0200 Received: from luther by lambda.u-strasbg.fr with local (Exim 3.22 #1 (Debian)) id 14joFa-0000Ap-00; Sun, 01 Apr 2001 22:15:02 +0200 Date: Sun, 1 Apr 2001 22:15:02 +0200 To: Hao-yang Wang Cc: caml-list@inria.fr Subject: Re: Overloading again (Was Re: [Caml-list] Interfacing C++ and Ocaml) Message-ID: <20010401221502.B635@lambda.u-strasbg.fr> References: <200103302033.MAA00807@imap.filemaker.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.3.15i In-Reply-To: <200103302033.MAA00807@imap.filemaker.com>; from hywang@pobox.com on Fri, Mar 30, 2001 at 12:41:43PM -0800 From: Sven LUTHER Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk On Fri, Mar 30, 2001 at 12:41:43PM -0800, Hao-yang Wang wrote: > >An even longer time ago I asked about overloading and got a nice long > >reply from Francois Rouaix, describing the history of overloading in Caml > >and ending with something like "Jun Furuse is now working on it". You can > >read about the latest incarnation of his work by going to > > > >http://pauillac.inria.fr/jfla/2001/actes/index.html > > > >and downloading > > > >Generic Polymorphism in ML > > > >which as you can guess is in English unlike his paper last year. > > > >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. > > > >-- Brian > > > Well, I re-read Francois Rouaix's long email, and at the end he said: > >In this type system, we still have static type-checking and inference, > >but there are some practical problems: coherence (as always when you do > >powerful overloading), true separate compilation, but more significantly, > >you have to define all "instances" of an overloaded function in a single > >"generic" definition. In most cases, this is not what the user wants. > > >From Jun Furuse's paper, it seems that we still have to define all > "instances" of an overloaded function in a single generic" definition. If > so, we cannot extend an existing function/operator, such as (+), to > parameters of new types. Could not some trick like the exception type be used, or maybe the polymorphic variant ? somethning like : let f1 = function | 'A x -> xxx | 'B x,y -> xx and later : let f1 = function | 'C x,y,z -> xxx | x -> f1 x enrobed with some nice syntaxic sugar ? Friendly, Sven Luther ------------------- To unsubscribe, mail caml-list-request@inria.fr. Archives: http://caml.inria.fr