Version française
Home     About     Download     Resources     Contact us    
Browse thread
Re: When functional languages can be accepted by industry?
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Michael Hohn <hohn@m...>
Subject: Re: When functional languages can be accepted by industry?

>> ...
>>    From: Markus Mottl <mottl@miss.wu-wien.ac.at>
>>    Date: Thu, 20 Apr 2000 20:52:34 +0200 (MET DST)
>>    Cc: caml-list@inria.fr (OCAML)
>>    Content-Type: text/plain; charset=us-ascii
>>    Sender: Pierre.Weis@inria.fr
>> 
>>    > In another life I wrote lots of numerical linear algebra programs, and I 
>>    > find that a little overloading would make the code a lot nicer.
>> 
>>    I admit: I don't write this much numerical code so I don't have many
>>    opportunities to complain about missing operator overloading there...
>> ...

Overloading is not needed in caml:  remember that you can define your
own infix operators.  I have done this for a minimalistic complex
number type, using +: -: /: and *:  Since the first (or first 2)
characters determine both precedence and associativity, this works
well. 
This also avoids the mixed-arithmetic errors, such as 
     x = 1/2 * y
which in e.g. Python will always return 0, but give type errors in
caml (when x and y are not integers)

Cheers,
Michael