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 PAA04328 for caml-redistribution@pauillac.inria.fr; Wed, 19 Apr 2000 15:12:03 +0200 (MET DST) Resent-Message-Id: <200004191312.PAA04328@pauillac.inria.fr> 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 NAA01612 for ; Wed, 19 Apr 2000 13:35:58 +0200 (MET DST) Received: from pop3.dassault-aviation.fr (pop3.dassault-aviation.fr [62.161.178.177]) by nez-perce.inria.fr (8.8.7/8.8.7) with ESMTP id NAA14875 for ; Wed, 19 Apr 2000 13:35:57 +0200 (MET DST) Received: from rnis.dassault-aviation.fr ([193.106.72.203]) by pop3.dassault-aviation.fr (Netscape Messaging Server 3.6) with ESMTP id AAA3F3; Wed, 19 Apr 2000 13:38:11 +0200 Received: from dassault-aviation.fr by rnis.dassault-aviation.fr (8.8.8+Sun/SMI-SVR4) id NAA02390; Wed, 19 Apr 2000 13:34:34 +0200 (MET DST) Message-ID: <38FD9B38.6691E0D6@dassault-aviation.fr> Date: Wed, 19 Apr 2000 13:40:40 +0200 From: "thierry BRAVIER" Organization: Dassault Aviation X-Mailer: Mozilla 4.08 [fr] (WinNT; I) MIME-Version: 1.0 To: caml-list@inria.fr Subject: Re: Caml wish list References: <38E7F364.5D24BB7C@motorola.com> <14572.49274.910966.673172@cylinder.csl.sri.com> <38ED71B6.30118608@motorola.com> <14574.1721.508470.790475@cylinder.csl.sri.com> <38F270CF.221F5BD0@motorola.com> <20000411195808.62154@pauillac.inria.fr> <38F3D520.9CD19485@motorola.com> <14581.28385.615880.93928@pc89.lri.fr> <14581.55775.16448.947429@tkb.mpl.com> <38F6E5C8.972110C3@univ-savoie.fr> Content-Type: multipart/alternative; boundary="------------F7A44BDAFAA5A0F4A1D1D6BA" Resent-From: weis@pauillac.inria.fr Resent-Date: Wed, 19 Apr 2000 15:12:03 +0200 Resent-To: caml-redistribution@pauillac.inria.fr --------------F7A44BDAFAA5A0F4A1D1D6BA Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable X-MIME-Autoconverted: from 8bit to quoted-printable by rnis.dassault-aviation.fr id NAA02390 Dear ocamlers, Christophe Raffalli a =E9crit: > Here is a list of request for Ocaml that would really make the libray > for formal and numerical calculus better (see > http://www.raffalli.univ-savoie.fr/~RAFFALLI/formel.html) : > > - include with ... and > - include in structure. would be great. > - Infix operator like + ... > R.+ should be an infix operator and R.(+) would be prefix. I would like that too. > One could event think to reuse symbols like + for many function= s. > Here is a simple proposal on how to do it that I would really e= njoy to > see working : > > Two new commands in OCaml structure (the syntax can be changed)= : > > share + : 'a -> 'a -> 'a > > this makes that + exists and is type-checked with type 'a -> 'a= -> 'a > > share + =3D add_int > share + =3D add_float > ... > I fear that your share proposal will not interact well with separate comp= iling of modules: how can the list of all share definition be completely know to the compil= er ? It reminds me of the now obsolete overload keyword in C++. > One could even allow some kind of recursive macros ! > > share + =3D fun (x,y) (x',y') -> (x+x', y+y') > share + =3D List.map2 (+) > share + =3D Array.map2 (+) > > This is a bit mode difficult to implement, but it seems feasibl= e. This, I think, is inspired by C++ templates and specialisation issues; I don't think it is in the spirit of ML because for instance adding a new= share definition could totally change the meaning of another previous share definition. Maybe there is anyhow a way to find a strict, satisfying meaning to share. Does somebody have insights ? Cheers. Thierry Bravier --------------F7A44BDAFAA5A0F4A1D1D6BA Content-Type: text/html; charset=us-ascii Content-Transfer-Encoding: 7bit Dear ocamlers,

Christophe Raffalli a écrit:

Here is a list of request for Ocaml that would really make the libray
for formal and numerical calculus better (see
http://www.raffalli.univ-savoie.fr/~RAFFALLI/formel.html) :

- include with ...

and
- include in structure.
would be great.
- Infix operator like + ...
        R.+ should be an infix operator and R.(+) would be prefix.
I would like that too.
        One could event think to reuse symbols like + for many functions.
        Here is a simple proposal on how to do it that I would really enjoy to
        see working :

        Two new commands in OCaml structure (the syntax can be changed):

        share + : 'a -> 'a -> 'a

        this makes that + exists and is type-checked with type 'a -> 'a -> 'a

        share + = add_int
        share + = add_float
        ...
 

I fear that your share proposal will not interact well with separate compiling of modules:
how can the list of all share definition be completely know to the compiler ?
It reminds me of the now obsolete overload keyword in C++.
 
        One could even allow some kind of recursive macros !

        share + = fun (x,y) (x',y') -> (x+x', y+y')
        share + = List.map2 (+)
        share + = Array.map2 (+)

        This is a bit mode difficult to implement, but it seems feasible.

This, I think, is inspired by C++ templates and specialisation issues;
I don't think it is in the spirit of ML because for instance adding a new share definition
could totally change the meaning of another previous share definition.

Maybe there is anyhow a way to find a strict, satisfying meaning to share.

Does somebody have insights ?

Cheers.

Thierry Bravier --------------F7A44BDAFAA5A0F4A1D1D6BA--