Go to the previous, next section.
The Emacs Lisp interpreter itself does not perform type checking on the actual arguments passed to functions when they are called. It could not do otherwise, since variables in Lisp are not declared to be of a certain type, as they are in other programming languages. It is therefore up to the individual function to test whether each actual argument belongs to a type that can be used by the function.
All built-in functions do check the types of their actual arguments
when appropriate and signal a wrong-type-argument error if an
argument is of the wrong type. For example, here is what happens if you
pass an argument to + which it cannot handle:
(+ 2 'a)
error--> Wrong type argument: integer-or-marker-p, a
Many functions, called type predicates, are provided to test whether an object is a member of a given type. (Following a convention of long standing, the names of most Emacs Lisp predicates end in `p'.)
Here is a table of predefined type predicates, in alphabetical order, with references to further information.
atom
arrayp
bufferp
byte-code-function-p
case-table-p
char-or-string-p
commandp
consp
floatp
frame-live-p
framep
integer-or-marker-p
integerp
keymapp
listp
markerp
natnump
nlistp
numberp
number-or-marker-p
overlayp
processp
sequencep
stringp
subrp
symbolp
syntax-table-p
user-variable-p
vectorp
window-configuration-p
window-live-p
windowp
Go to the previous, next section.