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

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2006-09-09 (07:57)
From: Erik de Castro Lopo <mle+ocaml@m...>
Subject: Re: [Caml-list] Memoization
Andrej Bauer wrote:

> I use the code below to show my students what can be done with
> higher-order functions. For a real implementation, we would have to use
> something more efficient than association lists (but then you might end
> up writing a polymorphic version of the Map module). Improvements are
> welcome.

Thanks Andrej, thats interesting. Is there any reason you didn't
use a Hashtbl instead of the association list? I don't really think 
the the ordering of the Map module is needed.

The particular function I'm trying to memoize is a function of
two integers. I was hoping it might be possible to write a
memoize function that memoizes any function of a small arbitrary
number of parameters. Thinking about it some more I'm beginning
to this this is not possible.

  Erik de Castro Lopo
Saying Python is easier than C++ is like saying that turning a 
light  switch on or off is easier than operating a nuclear reactor.