All Manuals > LispWorks User Guide and Reference Manual > 7 Dspecs: Tools for Handling Definitions

NextPrevUpTopContentsIndex

7.5 Details of built-in dspec classes and aliases

This section shows the dspec classes, subclasses and aliases provided by LispWorks. Subclasses are indented. Following the list of dspec classes are notes about some of these classes.

The system-defined dspec classes are:

COMPILER-MACRO (alias DEFINE-COMPILER-MACRO)
EDITOR:DEFCOMMAND (alias EDITOR:DEFINE-COMMAND-SYNONYM)
DEFINE-ACTION
DEFINE-ACTION-LIST
WIN32:DEFINE-DDE-CLIENT
WIN32:DEFINE-DDE-DISPATCH-TOPIC
DSPEC:DEFINE-DSPEC-CLASS (aliases DSPEC:DEFINE-SUBCLASS-DSPEC-CLASS, DSPEC:DEFINE-FUNCTION-DSPEC-CLASS)
  DSPEC:DEFINE-DSPEC-ALIAS
EDITOR:DEFINE-EDITOR-VARIABLE (alias EDITOR:DEFINE-EDITOR-MODE-VARIABLE)
FLI:DEFINE-FOREIGN-CALLABLE
FLI:DEFINE-FOREIGN-TYPE (alias FLI:DEFINE-FOREIGN-CONVERTER)
DSPEC:DEFINE-FORM-PARSER
CAPI:DEFINE-MENU
DEFSETF (aliases DEFINE-SETF-EXPANDER, DEFINE-SETF-METHOD)
DEFSYSTEM
FUNCTION
  DEFGENERIC
  DEFMACRO (alias DEFINE-MODIFY-MACRO)
  DEFUN (alias SYSTEM:DEFUN-AND-INLINE)
    FLI:DEFINE-FOREIGN-VARIABLE
    FLI:DEFINE-FOREIGN-FUNCTION (alias FLI:DEFINE-FOREIGN-FUNCALLABLE)
METHOD (alias DEFMETHOD)
METHOD-COMBINATION (alias DEFINE-METHOD-COMBINATION)
PACKAGE (alias DEFPACKAGE)
STRUCTURE (alias DEFSTRUCT)
TYPE
  DEFCLASS
    CAPI:DEFINE-INTERFACE
    CAPI:DEFINE-LAYOUT
    DEFINE-CONDITION
  STRUCTURE-CLASS
  DEFTYPE
VARIABLE
  DEFINE-SYMBOL-MACRO
  DEFCONSTANT
  DEFVAR (aliases DEFGLOBAL-PARAMETER, DEFGLOBAL-VARIABLE, DEFPARAMETER)

Further dspec classes are defined by modules such as com (on Microsoft Windows), kw and sql.

The canonical form of a symbol dspec is (function symbol) and the canonical form of a setf function name dspec is (function (setf symbol)).

7.5.1 Function dspecs

A function-dspec is a dspec that names a specific function. You can use a function-dspec when you need to specify a function by name, for example in trace, defadvice, and set-up-profiler.

A function-dspec can be either a symbol, a list of the form (setf symbol), or any dspec with a class that is a "function" class, that is function or any of the classes listed above under function. It can also be a method dspec as described in CLOS dspec classes or a subfunction dspec as described in Subfunction dspecs.

7.5.2 CLOS dspec classes

defgeneric and method can handle standard-generic-function and standard-method.

The canonical form of a defgeneric dspec is (defgeneric generic-function-name).

The canonical dspec of a method is:

(method function-name [method-qualifier] (parameter-specializer-name*))

Where function-name, method-qualifier and parameter-specializer-name match the ones in the defmethod form.

Each parameter-specializer-name must match the corresponding specializer for all the required parameters of the method. If a parameter is not specialized in the defmethod form then its parameter-specializer-name needs to be given as t.

For example, a method that is defined by:

(defmethod a-method ((arg1 cons) arg2 &optional arg3) ...)

has a dspec:

(method a-method (cons t))

and a method defined like this:

(defmethod initialize-instance :after ((a my-class)
                                       &key key1 key2)
  ...)

has a dspec:

(method initialize-instance :after (my-class))

7.5.3 Part Classes

method is a part class for defgeneric.

compiler-macro is a part class for function.

7.5.4 Foreign callable dspecs

For fli:define-foreign-callable the canonical name is the foreign name, with any machine-specific prefixes omitted.


LispWorks User Guide and Reference Manual - 20 Sep 2017

NextPrevUpTopContentsIndex