我想在球拍中使用列表完成一个学校问题。这是一个简单的问题使用递归,但我不明白为什么我的代码不会工作。如果提供的项目与列表中的项目匹配,我们应该搜索列表并返回true。这是我到目前为止有:使用递归的球拍列表错误
(define (containsAnywhere test list)
(cond
((null? list) '())
(equal?((car list) test))
(else(containsAnywhere (test (cdr list))))))
,但我得到了以下错误:
application: not a procedure;
expected a procedure that can be applied to arguments
given: 1
arguments.: