- The atom t represents true.
- nil and () and '() are equivalent and represent false.
- Anything that is not nil also represents true.
- The predicate =. Example: (= 4 4)
- The predicate eq. Example: (eq 'apple 'orange)
- The predicate equal. Example: (equal '(1 2) '(1 2))
- The predicate member. Example: (member 2 '(1 2 3))
- Keyword arguments.
(member '(1 2) '((1 1)(1 2)(1 3)))
versus
(member '(1 2) '((1 1)(1 2)(1 3)) :test #'equal)
- The predicate listp.
- The predicate atom.
- The predicate numberp.
- The predicate symbolp.
- The predicate null.
- The predicate endp.
- The predicates >, <, >=, <=.
- The boolean operators and, or, not. Example: (and t nil t)
- The conditional if. The else part is optional.
(if (> a b) ;; condition, a and b must have values
(+ a 1) ;; do this ONE statement if true
(+ b 1) ;; do this ONE statement if false
)
- The conditional cond. This statement is equivalent
to an if-elseif-elseif-etc construct.
(cond
( test1 statement-1 ... statement-n )
( test2 statement-1 ... statement-m )
...
( testk statement-1 ... statement-p )
)
(cond
((> temp 80) 'hot)
((> temp 60) 'warm)
(t 'cool-or-cold)
)
- The conditional case.
(case temperature
(100 'hot)
(99 'hot)
...
(otherwise 'unknown)
)