Version française
Home     About     Download     Resources     Contact us    
Browse thread
Memoization
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
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.

Cheers,
Erik
-- 
+-----------------------------------------------------------+
  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.