All Manuals > LispWorks® User Guide and Reference Manual > 35 The DSPEC Package

object-dspec Function

Summary

Returns the dspec of an object.

Package

dspec

Signature

object-dspec object => dspec

Arguments
object
Any object.
Values
dspec
A dspec or nil.
Description

The function object-dspec returns a dspec for object if there is one, or nil otherwise. When the result dspec is not nil, it is a dspec as described in 7.2 Forms of dspecs.

An object has a dspec only when it represents the result of some definition. The most useful cases are functions (of any kind) and methods, because their dspecs can be used to trace and advise them. Classes and packages also have dspecs.

Dspecs can also be useful for finding where the definition of the object originated, either by using dspec functions like find-dspec-locations, which returns the location, or using the editor command Find Source For Dspec, which edits them. The Common Lisp function ed also recognizes dspecs and goes to the source.

If object does not have a dspec then object-dspec returns nil.

See also

trace
defadvice
find-dspec-locations


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