Exercise 1.5
(define (p) (p)) (define (test x y) (if (= x 0) 0 y))
Then we evaluates the expression
(test 0 (p))
What behavior will it with an interpreter that uses applicative-order evaluation?
(test 0 (p)) ->(test 0 (p)) ->(test 0 (p)) ->.....
When the interpreter uses applicative-order evaluation, it evaluate first (p). And it will be evaluated as (p) all the time.
So, if the interpreter uses applicative-order, the 'test' procedure will not come to an end.
What behavior will it with an interpreter that uses normal-order evaluation?
(test 0 (p)) ->(if (= 0 0) 0 (p)) ->0
When the interpreter uses normal-order evaluation, the (p) procedure will be evaluated later.
So, the behavior will be an end.