[Newbies] Memoization (was: Beginners Digest, Vol 18, Issue 2)

Bert Freudenberg bert at freudenbergs.de
Thu Oct 4 09:11:32 UTC 2007


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 -




More information about the Beginners mailing list