caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Sven LUTHER <luther@dpt-info.u-strasbg.fr>
To: Hao-yang Wang <hywang@pobox.com>
Cc: caml-list@inria.fr
Subject: Re: Overloading again (Was Re: [Caml-list] Interfacing C++ and Ocaml)
Date: Sun, 1 Apr 2001 22:15:02 +0200	[thread overview]
Message-ID: <20010401221502.B635@lambda.u-strasbg.fr> (raw)
In-Reply-To: <200103302033.MAA00807@imap.filemaker.com>; from hywang@pobox.com on Fri, Mar 30, 2001 at 12:41:43PM -0800

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


  reply	other threads:[~2001-04-01 20:14 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-03-30 20:41 Hao-yang Wang
2001-04-01 20:15 ` Sven LUTHER [this message]
2001-04-02 11:07   ` Sven LUTHER
  -- strict thread matches above, loose matches on Subject: below --
2001-03-30  8:54 [Caml-list] Interfacing C++ and Ocaml David Chemouil
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
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

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=20010401221502.B635@lambda.u-strasbg.fr \
    --to=luther@dpt-info.u-strasbg.fr \
    --cc=caml-list@inria.fr \
    --cc=hywang@pobox.com \
    /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;
as well as URLs for NNTP newsgroup(s).