All Manuals > LispWorks® User Guide and Reference Manual > 33 The COMMON-LISP Package

documentation Generic Function

Summary

Extended to add methods for dspec:dspec.

Package

common-lisp

Signature

documentation object doc-type => documentation

Arguments
object
Any object.
doc-type
A symbol.
Values
documentation
A string or nil.
Description

The generic function documentation operates as specified in the ANSI Common Lisp standard, returning documentation for object and doc-type.

There are also additional methods with signatures:

documentation (dspec t) (doc-type (eql 'dspec:dspec))
(setf documentation) new-value (dspec t) (doc-type (eql 'dspec:dspec))

are provided.

This method allows finding or setting the documentation string when you know the dspec. See 7 Dspecs: Tools for Handling Definitions for information about dspecs.

dspec must be a dspec, but it can be non-canonical. This method canonicalizes dspec and then calls documentation with the name as the first argument and the appropriate dspec class name as the second, thereby calling a standard documentation method.

If you define your own type of definitions (def-saved-value for example) with define-dspec-class you can add methods on documentation for your dspec class:

(documentation (dspec t) (doc-type (eql 'def-saved-value))

This allows commands in the LispWorks IDE such as Expression > Documentation to display the documentation.

See also

documentation in the Common Lisp HyperSpec


LispWorks® User Guide and Reference Manual - 01 Dec 2021 19:30:30