You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
32 lines
442 B
32 lines
442 B
2 years ago
|
|
||
|
Exercise 4.27: 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.242
|
||
|
|
||
|
|
||
|
(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⟩
|