Go to the first, previous, next, last section, table of contents.


Predicate Functions

In Lisp, a function which returns a boolean `true' or boolean `false' value is called a predicate. As is the convention in Lisp a value of nil means false, anything else means true. The symbol t is often used to represent a true value (in fact, sometimes the symbol t should be read as any non-nil value).

Another Lisp convention is that the names of predicate functions should be the concept the predicate is testing for and either `p' or `-p'.

The `p' variant is used when the concept name does not contain any hyphens.

For example a predicate to test for the concept const-variable (a variable which has a constant value, see section Constant Variables) would be called const-variable-p. On the other hand a predicate to test for the concept buffer (a Lisp object which is a buffer) would be called bufferp.


Go to the first, previous, next, last section, table of contents.