Version française
Home     About     Download     Resources     Contact us    
Browse thread
[Caml-list] generic programming
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Alessandro Baretta <alex@b...>
Subject: Re: [Caml-list] Re: generic programming
Oleg wrote:
> On Wednesday 03 July 2002 01:29 pm, Chris Hecker wrote:
> 
> 
>>Perhaps he's reading and can explain some of the problems.
>>
>>Caml polymorphism&functors and C++ templates seem to have different
>>properties, and I wonder what you can and can't write in each.
> 
> 
> I'm also concerned about compilation times. When writing C++ code, having to 
> keep template definitions in header files in their entirety is frequently my 
> reason not to write templated code.

Templates are "nasty" citizens of the C++ world. I've had 
*so* many problems tracking down bugs in code using STL 
templates. Basically, the "write once, compile many" 
strategy of C++ yields situations where the semantics of the 
algorithms coded in a template depends upon the type 
parameter you pass to the template itself. Abominable.

Stick to Caml: "Write Once, Compile Once, Link Many".

Alex



-------------------
To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr
Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners