【发布时间】:2014-11-04 19:15:36
【问题描述】:
我对 LISP 比较陌生,我正在为我正在尝试为演示文稿创建的 Lisp 程序尝试一些新东西。
我需要能够打印列表中的所有其他字符,例如,(A B C D E F) 将返回 (A C E) .. 但我很容易混淆...
我通常是 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...
任何帮助将不胜感激..
谢谢!
【问题讨论】: