logo       

Memoization (was: Beginners Digest, Vol 18, Issue 2): msg#00016

lang.smalltalk.squeak.beginners

Subject: Memoization (was: Beginners Digest, Vol 18, Issue 2)

On Oct 4, 2007, at 10:54 , Oscar Nierstrasz wrote:

Cacheing Fibonacci is a nice standard example for memoizing that we use in our Smalltalk course.
[...]
Now Fibs new at: 100
is linear and virtually instantaneous.

... though with "real" memoization you would get sub-linear amortized cost on repeated calls (by reusing the Fibs instance or in a class var).

Which makes me wonder if there is a standard Smalltalk practice for generic memoization. The only thing that comes to my mind is Method Wrappers, but for some reason that doesn't seem to be a common application or even example for their use.

- Bert -


<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

News | FAQ | advertise