What does the letter "t" mean in LISP?
Example:
(defun last2 (lst) (cond ((null lst) nil) ((null (cdr lst)) (car lst)) (t (last2 (cdr lst)))))
My textbook is a course, so it does not quite explain all the meanings. Thanks.
T is the canonical true value in Common Lisp. Here it is used as ELSE, ensuring that the last branch of COND is always correct. (Any value other than NIL is also considered true.)
See the Common Lisp Hyperspec Glossary for t .
t n. 1. a. boolean representing true. b. the canonical generalized Boolean representation is true. (Although any object other than nil is considered true as a generalized logical, t is usually used when there is no particular reason to prefer one such object over another.) ...