我对 LISP 比较陌生,并且正在为我尝试为演示文稿创建的 Lisp 程序尝试一些新东西。
我需要能够打印列表中的所有其他字符,例如, (ABCDEF) 将返回 (ACE) .. 但我很容易混淆......
我通常是编程 Java,所以这对我来说有点不同。
我正在尝试使用纯递归对此进行编程..所以类似于....
(defun every-other (lst)
(cond ((null lst) 0)
(( **** now this is where I get confused as to what I should do..
I've tried adding a counter to only remove even numbered elements, but I think I implemented the counter wrong, I also tried remove(cadr lst) lst, but that would only return zeros...
任何帮助将不胜感激..
谢谢!