Version française
Home     About     Download     Resources     Contact us    
Browse thread
how to implement generic operators
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: skaller <skaller@u...>
Subject: Re: Ant: [Caml-list] how to implement generic operators
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 <skaller at users dot sf dot net>
Felix, successor to C++: http://felix.sf.net