<< Previous exercise (3.26) | Index | Next exercise (3.28) >>
Instead of recoding fib into memo-fib as shown in SICP (which seems like a very error-prone way of adding memoize to an existing function). The following works in DrRacket using #lang racket
(set! fib (memoize fib))
It sets fib in the global environment to (memoize fib) which also causes the recursive calls within fib to call the redefined version.
meteorgan