Selected LISP primitives Pocket Reference Sheet Entries are described as FUNCTIONS, PREDICATES, MACROS, or SPECIAL FORMS. FUNCTIONS evaluate all their arguments and return a value. PREDICATES are functions that always return either t or nil. MACROS and SPECIAL FORMS do not always evaluate all their arguments. Currently approximately 40 LISP primitives are documented here. Eventually just over 100 primitives will be documented. We adopt the convention of using angle brackets <> to indicate where appropriate text should be inserted when using these primitives; the examples should make this clear. In many of the descriptions below, the notion of list is used when either a list or a LISP data type known as the dotted pair would be acceptable. Beginners generally need not use dotted pairs, so they are ignored for the sake of simplicity here. ---- • * (FUNCTION) (* ...) • + (FUNCTION) (+ ...) • - (FUNCTION) (- ...) • 1+, 1- (FUNCTIONS) (1+ ) (1- ) • = (PREDICATE) (= ...) • <> <=, >= (PREDICATES) (< ... ) (...) • and (MACRO) (and ... ) • append (FUNCTION) (append ... ) • apply (FUNCTION) (apply ) (apply ... • atom (PREDICATE) (atom ) • butlast (FUNCTION) (butlast ) (butlast ) • car (FUNCTION) car is an archaic form of the function first and the two may be used interchangeably. • caar, cadr, etc. (FUNCTIONS) (c-r ) • cdr (FUNCTION) See the entry for rest: cdr is the older name for rest. • cond (MACRO) (cond ( ) ( ) . . ( )) • cons (FUNCTION) (cons ) • defun (MACRO) (defun ( ... ) ) • do (SPECIAL FORM) (do (( ) ( ) . . ( )) ( ) ) • documentation (FUNCTION) (documentation ) • eql (PREDICATE) (eql ) • eval (FUNCTION) (eval ) • evenp, oddp (PREDICATES) (evenp ) (oddp ) • first (FUNCTION) (first ) • if (SPECIAL FORM) (if ) • length (FUNCTION) (length ) • let (SPECIAL FORM) (let (( ) ( ) . . ( )) ) • list (FUNCTION) (list ...) • listp (PREDICATE) (listp ) • mapcar (FUNCTION) (mapcar . . . ) • max, min (FUNCTIONS) (max ... ) (min ... ) • member (FUNCTION) (member :test :test-not :key ) • not (PREDICATE) (not ) • nth (FUNCTION) (nth ) • nthcdr (FUNCTION) (nthcdr ) • null(PREDICATE) (null ) • numberp (PREDICATE) (numberp ) • or (MACRO) (or ... ) • read (FUNCTION) (read ) • reverse (FUNCTION) (reverse ) • second, third, etc. (FUNCTIONS) (second ) (third ) etc. • setf (MACRO) (setf . . ) • symbolp (PREDICATE) (symbolp ) • y-or-n-p, yes-or-no-p (PREDICATES) (y-or-n-p) (y-or-n-p ) (yes-or-no-p) (yes-or-no-p )