4.2.2. An Interpreter with Lazy Evaluation
Exercise 4.29

Demonstrate the benefits of memoization

Exhibit a program that you would expect to run much more slowly without memoization than with memoization. Also, consider the following interaction, where the id procedure is defined as in exercise 4.27 and count starts at 0:

(define (square x)
  (* x x))
;;; L-Eval input:
(square (id 10))
;;; L-Eval value:
;;; L-Eval input:
;;; L-Eval value:

Give the responses both when the evaluator memoizes and when it does not.

Nobody's finished this exercise yet. You'll be the first!

There are no comments yet.

Authentication required

You must log in to post a comment.