Open
Description
(define (eval-or exp env)
(if (null? exp)
true
(or (eval (car exp) env)
(eval-or (cdr exp) env))))
应该为
(define (eval-or exp env)
(if (null? exp)
false
(or (eval (car exp) env)
(eval-or (cdr exp) env))))
后面实现为派生表达式,我认为应该为
(define (eval-and exp env)
(make-if (null? exp)
true
(make-if (car exp)
(eval-add (cdr exp) env)
false)))
但是,我感觉用派生表示式的话,就没有短路效果了!
Metadata
Assignees
Labels
No labels