[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Memoizing a function.
- From: Luiz Henrique de Figueiredo <lhf@...>
- Date: Sat, 6 Oct 2001 10:52:27 -0300
>This is my first stab at lua programming. And I have not studied the
>available documantation all that much. I wonder if there is an elegant
>way of of memoizing functions. My first try is this:
See lua/test/fib.lua . It includes a generic function that caches the values
of arbitrary (one-arg/one-result) functions and is applied to the fibonacci
function.
--lhf