我需要实现函数,该函数根据传递给函数的参数创建一个列表。函数意外的结果(递归)
这里是我的代码:
(defun lstbuilder (&rest args)
(if (eq (car args) NIL)
NIL
(cons (car args)
(lstbuilder (cdr args)))))
此功能无法正常工作。 结果:
(lstbuilder 'a 'b 'c 'd 'e) ;expected (a b c d e)
(a (b c d e)) ;result
任何你没有以更简单的方式实现它的原因((defun lstbuilder(&rest args) args)' – PuercoPop