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
Custom operators in the revised syntax
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2007-05-11 (14:43)
From: Jon Harrop <jon@f...>
Subject: Re: [Caml-list] Custom operators in the revised syntax
On Friday 11 May 2007 15:15, Loup Vaillant wrote:
> I tend to agree when one says custom operators are evil. However, when
> the default syntax uses operators, the custom ones are a net win : a
> wise programmer will use their semantic load carefully (big nums, for
> example)

Ints, nats, floats, complexes, quaternions, column and row vectors, matrices, 
tensors, inner and outer products, symbolic expressions... This is why I like 
operator overloading.

For example, Smoke has the multiplications: * (int), *. (float), *| (vector 
scaling), *|| (matrix-vector transform) and *||| (matrix-matrix multiply).

Operator overloading and template metaprogramming were the only things I 
missed moving from C++ to OCaml. :-)

Dr Jon D Harrop, Flying Frog Consultancy Ltd.
The F#.NET Journal