sicp 1.5

xiaoxiao2026-06-04  11

下面这段代码:

 

(define (p) (p)) (define (test x y) (if (= x 0) 0 y)) (test 0 (p))

应用序(applicative-order)求值:

(test 0 (p))

(test 0 (p))

...

求值过程不会结束,DrScheme即是应用序求值

 

正则序(normal-order)求值:

(test 0 (p))

(if (= 0 0) 0 (p))

0

结果为0

转载请注明原文地址: https://www.6miu.com/read-5049592.html

最新回复(0)