English version
Accueil     À propos     Téléchargement     Ressources     Contactez-nous    

Ce site est rarement mis à jour. Pour les informations les plus récentes, rendez-vous sur le nouveau site OCaml à l'adresse ocaml.org.

Browse thread
RE: [Caml-list] Operator overloading
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2007-03-09 (07:23)
From: Tom <tom.primozic@g...>
Subject: Re: [Caml-list] Operator overloading
On 09/03/07, skaller <skaller@users.sourceforge.net> wrote:
> BOTH Ocaml functors and overloading are just hacks to
> work around the lack of ability to properly express
> higher order natural transformations.

 Hm... indeed, but for some operations, you cannot provide a single, general
definition - say for length operation, or for * (* is very different when it
comes to scalars, vectors and matrices - not even the same axioms hold). I
believe that the basic operations should be implemented using overloading
(actually, some smart overloading that would allow both static and
(seemingly) dynamic resolving) and then polyadic operations be built on top
of that.

For systems like Ocaml, you need a mix of sloppiness
> and heavy typing, because unless you're implementing
> a well understood mathematical formalism, too much
> formality and abstraction just gets in the way.
> For example if you were implementing a C++ compiler in Ocaml
> I'm going to bet you'd want plenty of space to fiddle with
> your representations and concepts, because you don't quite
> know what it is you're actually implementing.

I have a feeling what you say here is important, yet I don't quite
understand it... Can you clarify it ang give an example? And how (in your
opinion) can this problem be solved?

- Tom