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
[Caml-list] Functors
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2004-05-02 (13:34)
From: Jon Harrop <jdh30@c...>
Subject: Re: [Caml-list] Functors
On Sunday 02 May 2004 11:24, Martin Jambon wrote:
> On Sun, 2 May 2004, Jon Harrop wrote:
> > Functors appear to be somewhat similar to templates in C++. Does the
> > functor approach produce more efficient code as it is partially
> > specialised over the comparison function?
> Unfortunately no.
> ...
>   http://www.lri.fr/~signoles/ocamldefun/manual.html

Wow, ok. So ocamldefun maps ocaml code with functors onto ocaml code without 
functors and, according to their examples, this can result in an 8 times 
performance improvement due to inlining.

This begs the question: why is this functionality not in the compiler? In 
fact, using functors with the current compiler actually reduces 


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