From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Original-To: caml-list@yquem.inria.fr Delivered-To: caml-list@yquem.inria.fr Received: from concorde.inria.fr (concorde.inria.fr [192.93.2.39]) by yquem.inria.fr (Postfix) with ESMTP id 4F1D7D45F for ; Tue, 25 Oct 2005 03:56:26 +0200 (CEST) Received: from smtp3.adl2.internode.on.net (smtp3.adl2.internode.on.net [203.16.214.203]) by concorde.inria.fr (8.13.0/8.13.0) with ESMTP id j9P1uOCV026852 for ; Tue, 25 Oct 2005 03:56:25 +0200 Received: from rosella (ppp14-90.lns2.syd7.internode.on.net [59.167.14.90]) by smtp3.adl2.internode.on.net (8.12.9/8.12.6) with ESMTP id j9P1uJDM065071; Tue, 25 Oct 2005 11:26:20 +0930 (CST) (envelope-from skaller@users.sourceforge.net) Subject: Re: Ant: [Caml-list] how to implement generic operators From: skaller To: Martin Chabr Cc: caml-list@yquem.inria.fr In-Reply-To: <20051024182654.24834.qmail@web26808.mail.ukl.yahoo.com> References: <20051024182654.24834.qmail@web26808.mail.ukl.yahoo.com> Content-Type: text/plain Date: Tue, 25 Oct 2005 11:56:18 +1000 Message-Id: <1130205379.18325.63.camel@rosella> Mime-Version: 1.0 X-Mailer: Evolution 2.2.1.1 Content-Transfer-Encoding: 7bit X-Miltered: at concorde with ID 435D90C8.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Spam: no; 0.00; caml-list:01 ocaml:01 syntax:01 fpls:01 ocaml:01 inference:01 overloading:01 inference:01 g'caml:01 compiler:01 wrote:01 sourceforge:01 encode:01 integer:01 conflicts:01 X-Spam-Checker-Version: SpamAssassin 3.0.3 (2005-04-27) on yquem.inria.fr X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=disabled version=3.0.3 On Mon, 2005-10-24 at 20:26 +0200, Martin Chabr wrote: > I was surprised at first when I found out how OCaml > restricts lists. I was even more surprised when I > learned about the distinction between the integer and > floating operators (+ and * vs +. and *. etc.): > Now I got used to it and appreciate the clarity: Felix is designed for people who, like you, are a bit surprised at the lack of generics .. but unlike you are not so patient.. :) It therefore provides something more C++ like in both syntax and features, whilst still providing many of the features of ML style FPLs like Ocaml. Type inference is one of the things lost, since I'm not smart enough to encode a type system supporting both overloading and inference, nor figure out what the consequences would be for the end user -- systems with type inference typically produce lousy error messages, so I'd guess developers of these systems don't themselves know enough about how to properly track and report inference conflicts (i.e. type errors) -- so there is little hope of a good resolution at this time for a system with both. G'Caml generics may solve this problem by encapsulating the overloads in a way the compiler can report type sane type errors. -- John Skaller Felix, successor to C++: http://felix.sf.net