原始问题:编写一个递归 Racket 函数“more”,它接受两个列表 xs 和 ys 作为参数,如果 xs 的元素多于 ys,则返回 true,否则返回 false。例如 (more '(1 2 3) '(1 2)) 应该评估为真,而 (more '(1 2 3) '(0 1 2)) 应该评估为假。
(define (more xs ys)
(if (empty? ys)
(if (empty? xs) #false #true)
(if (empty? xs) #false (more (cdr xs) (cdr ys)))))
(writeln (more '(1 2 3) '(1 2)))
(writeln (more '(1 2 3) '(0 1 2 3)))
(writeln (more '(1 2 3) '(0 1 2)))
我收到“:13:空?:未绑定标识符:空?”的错误 “空”如何?未绑定的标识符。