字母“t”在 LISP 中是什么意思?
例如:
(defun last2 (lst)
(cond ((null lst) nil)
((null (cdr lst)) (car lst))
(t (last2 (cdr lst)))))
我的教科书是一个类(class)包,所以它并没有完全解释所有的含义。 谢谢。
最佳答案
T 是 Common Lisp 中的规范真值。这里它被用作 ELSE,确保 COND 的最后一个分支始终为真。 (除 NIL 以外的任何值也算作真。)
关于LISP 术语,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13596115/