0
(define (substitute s old new)
(if (null? s)
'()
(if (list? (car s) false)
(cond ((eq? (car s) old)
(cons new (substitute (cdr s) old new)))
(else
(cons (car s) (substitute (cdr s) old new)))))
(if (list? (car s)
(cons (substitute (car s) old new) (substitute (cdr s) old new))))))
我得到的错误说这是不好的语法 - 为什么可能是什么线索? 该函数应该包含在一个列表中,以及一个旧的单词,如果它存在于列表中,则被新单词替换。替换方案中的列表元素