next up previous
Contents Next: eql (PREDICATE) Up: Appendix: Selected Lisp Previous: do (SPECIAL FORM)

documentation (FUNCTION)

Format: (documentation <func> <type> )

Required arguments: 2

<func> must evaluate to the name of a function <type> must be function, variable, type, structure, or setf (see below)

This function is useful from the command line for a quick reminder of the format and usage of certain Lisp primitives. Both arguments are usually quoted symbols. See examples below.


> (documentation 'documentation 'function)
Args: (symbol doc-type)
Returns the doc-string of DOC-TYPE for SYMBOL; NIL if none exists.
Possible doc-types are:
        FUNCTION  (special forms, macros, and functions)
        VARIABLE  (dynamic variables, including constants)
        TYPE      (types defined by DEFTYPE)
        STRUCTURE (structures defined by DEFSTRUCT)
        SETF      (SETF methods defined by DEFSETF, DEFINE-SETF-METHOD, and
All built-in special forms, macros, functions, and variables have their

> (documentation 'cdr 'function)
Args: (list)
Returns the cdr of LIST.  Returns NIL if LIST is NIL."

> (documentation 'pi 'variable)
The floating-point number that is appropriately equal to the ratio of the
circumference of the circle to the diameter."

© Colin Allen & Maneesh Dhagat
March 2007