A predicate is a function which tests for some condition involving its arguments and returns the symbol t if the condition is true, or the symbol nil if it is not true. By convention, the names of predicates usually end in the letter "p" (which stands for "predicate"). (See [section on naming conventions]).
The following predicates are for testing data types. These predicates return t if the argument is of the type indicated by the name of the function, nil if it is of some other type.
symbolp returns t if its argument is a symbol, otherwise nil .
listp returns t if its argument is a cons, otherwise nil . (listp nil) is nil even though nil is the empty list.
The predicate atom returns t if its argument is not a cons, otherwise nil .
numberp returns t if its argument is any kind of number, otherwise nil .
stringp returns t if its argument is a string, otherwise nil .
arrayp returns t if its argument is an array, otherwise nil . Note that strings are arrays.
closurep returns t if its argument is a closure, otherwise nil .
locativep returns t if its argument is a locative, otherwise nil .
:symbol | A symbol. |
:fixnum | A fixnum. |
:flonum | A flonum. |
:small-flonum | A small flonum. |
:bignum | A bignum. |
:list | A cons. |
:string | A string. |
:array | An array that is not a string. |
:random | Any built-in data type that does not fit into one of the above categories. |
foo | An object of user-defined data-type foo (any symbol). See Named Structures, this link. |