4.2.2. An Interpreter with Lazy Evaluation
The interaction between lazy evaluation and side effects
Suppose we type in the following definitions to the lazy evaluator:
(define count 0)
(define (id x)
(set! count (+ count 1))
x)
Give the missing values in the following sequence of interactions, and explain your answers.
(define w (id (id 10)))
;;; L-Eval input:
count
;;; L-Eval value:
response
;;; L-Eval input:
w
;;; L-Eval value:
response
;;; L-Eval input:
count
;;; L-Eval value:
response
Nobody's finished this exercise yet. You'll be the first!