Next: , Up: Truth   [Contents][Index] True and False

In Common Lisp, the symbol ‘t’ is the default representation for truth. Like ‘nil’, ‘t’ evaluates to itself. The function listp returns true if its argumentis a list:

> (listp ’(a b c))


A function whose return value is intended to be interpreted as truth or falsity is called a predicate. Common Lisp predicates often have names that end with ‘p’.

Falsity in Common Lisp is represented by ‘NIL’, the empty list. If we give listp an argument that isn’t a list, it returns ‘NIL’:

> (listp 27)

Although ‘t’ is the default representation for truth, everything except ‘NIL’ also counts as true in a logical context.