【发布时间】:2021-06-06 21:58:23
【问题描述】:
它应该计算列表的元素,但显示“*** - +:NIL 不是数字”
(setq A '(2 3 4 3 2 6 7 8 4 3 5 6))
(defun big (A)
(if (not (null (car A))) (+ 1 (big (cdr A))) ) ;if the first element is not null, add 1 to the count of the elements to the rest of the list
)
(print (big A))
【问题讨论】:
-
您是否使用在线解释器来评估 Lisp 代码?你的设置是什么?
标签: lisp common-lisp