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 -


_______________________________________________
Beginners mailing list
Beginners@lists.squeakfoundation.org
http://lists.squeakfoundation.org/mailman/listinfo/beginners

Reply via email to