The static-dispatch Reference Manual

Table of Contents

Next: , Previous: , Up: (dir)   [Contents][Index]

The static-dispatch Reference Manual

This is the static-dispatch Reference Manual, version 0.3, generated automatically by Declt version 3.0 "Montgomery Scott" on Mon Apr 19 17:52:40 2021 GMT+0.


Next: , Previous: , Up: Top   [Contents][Index]

1 Introduction

STATIC-DISPATCH

Static dispatch is a library, inspired by inlined-generic-function, which allows standard Common Lisp generic function dispatch to be performed statically (at compile time) rather than dynamically (runtime). This is similar to what is known as "overloading" in languages such as C++ and Java.

The purpose of static dispatch is to provide an optimization in cases where the usual dynamic dispatch is too slow, and the dynamic features of generic functions, such as adding/removing methods at runtime are not required. An example of such a case is a generic equality comparison function. Currently generic functions are considered far too slow to implement generic arithmetic and comparison operations when used heavily in numeric code.

How it works

The shadowed DEFMETHOD macro stores the body of the method in a global variable which contains a hash-table mapping generic functions to their methods.

A compiler macro function is added to the generic function which determines the types of the arguments and replaces the function call form with the body of the most specific applicable method. If the types cannot be determined, or there isn't enough type information the generic function call is left as is. Thus in order to choose the appropriate method at compile-time rather than runtime, the types of the arguments either have to be declared using DECLARE or surrounded in a THE form.

Usage

The package STATIC-DISPATCH-CL is provided which contains all symbols in the COMMON-LISP package and the shadowed DEFMETHOD macro. This package should be used/imported instead of COMMON-LISP as besides exporting the shadowed DEFMETHOD symbol, it also exports all symbols shadowed by the CLOSER-COMMON-LISP package (from closer-mop) which are necessary for closer-mop to function correctly.

Generic functions and methods are defined as usual, using DEFGENERIC and DEFMETHOD. Generic functions are dispatched dynamically, and are identical to standard Common Lisp generic function, until the following declaration is in place:

  1. (INLINE <generic function name>)

In order for the appropriate method to be chosen directly the arguments to the generic function call form should be one of the following:

Otherwise no method is chosen and the generic function call form is left as is.

Both EQL and class specializers are supported. EQL methods will only be chosen statically if the argument is one of the following and is EQL to the specializer's value.

Note: Even if a variable is bound (by LET) to a value that is EQL to the specializer's value, it will not be chosen unless it has a TYPE (EQL ...) declaration.

CALL-NEXT-METHOD and NEXT-METHOD-P are supported fully.

The standard method combination is supported, along with :BEFORE, :AFTER and :AROUND methods, however user-defined method combinations are not supported. You can still use a generic function with a user-defined method combination in your code however it will not be statically dispatched.

Note: In order for type and inline declarations to be made available, to the compiler macro, consistently across implementations the ENABLE-HOOK function has to be called at some point, see https://github.com/alex-gutev/cl-environments#documentation for more information.

Optimize Declarations

The optimize speed and safety declarations affect the code that is inserted in place of the generic function call expression. Specifically, the definition of the lexical CALL-NEXT-METHOD functions.

The types of the arguments which may be passed to CALL-NEXT-METHOD are unknown. An optimize declaration with a SAFETY level greater than or equal to the level for SPEED will result in type checks, using CHECK-TYPE, being inserted in the CALL-NEXT-METHOD definition to check that the arguments are of the expected type given in the method's specializer list. This will result in a condition being raised if arguments of an incorrect type are passed to CALL-NEXT-METHOD. However, if the SPEED optimize level is greater than the SAFETY level the type checks are not inserted. It is then the programmer's responsibility to ensure that the arguments passed to CALL-NEXT-METHOD are of the types specified in specializer list of the next most specific method. If CALL-NEXT-METHOD is called with no arguments, which means it is called with the same arguments passed to the current method, the arguments are guaranteed to be of the correct type.

Examples

Given a generic function with the following methods:

(defmethod foo ((a number))
  (list :number a))

(defmethod foo ((a integer))
  (list :integer (call-next-method (1+ a))))

An optimize declaration such as the following will result in type checks being inserted:

(locally
  (declare (inline foo)
           (optimize (speed 2) (safety 2)))

  (declare (type integer x))

  (foo x))

This results in the expression (foo x) being replaced with something similar to the following (simplified to remove the case of CALL-NEXT-METHOD being called with no arguments):

(flet
  ((call-next-method (x)
     (check-type x number)
     (list :number x)))

 (list :integer (call-next-method (1+ x))))

If the optimize declaration is changed to (optimize (speed 3) (safety 0)), the type checks are omitted which results in the following:

(flet
  ((call-next-method (x)
     (list :number x)))

 (list :integer (call-next-method (1+ x))))

Interaction with other Compiler Macros

By default Static-Dispatch does not add a compiler macro to a generic function which already has a compiler macro function. To statically dispatch such functions the STATIC-DISPATCH function has to be called manually from the compiler macro.

Function: STATIC-DISPATCH FORM &OPTIONAL ENV

Determines whether to statically dispatch the call to the generic function FORM. If so returns the body of the selected method otherwise returns FORM as is.

ENV is the lexical environment of the generic function call.

Common Pitfalls

The semantics of generic functions are changed when statically dispatched, that is when they are declared inline in the environment in which they are called.

Statically dispatched generic functions are dispatched based on the declared types of the arguments at compile-time. The declared type may differ from the actual runtime type of the argument, which may result in a different method being called when statically dispatched from when the generic function is dynamically dispatched. A useful analogy is that dynamically dispatched generic functions have the semantics of C++ virtual methods whereas statically dispatched functions have the semantics of overloaded functions/methods in C++ and Java.

Consider the following methods:

(defmethod foo ((a number))
  (list :number a))

(defmethod foo ((a integer))
  (list :integer a))

And consider the following code:

(let ((x 1))
  (declare (type number x)
           (inline foo))

  (foo x))

When statically dispatched, as in the above example with the (INLINE FOO) declaration, the method specialized on NUMBER will be called and hence (FOO X) will evaluate to (:NUMBER 1). However since X is actually bound to an integer value, with dynamic dispatch, when the (INLINE FOO) declaration is removed, the method specialized on INTEGER will be called and hence (FOO X) will evaluate to (:INTEGER 1).

It's also possible that a particular implementation may change the declared type of a variable to a subtype if it can be deduced to be of that subtype, so in this example the declaration (TYPE NUMBER X) maybe changed to (TYPE INTEGER X) by the implementation. As a result it's not even possible to rely on the declaration forcing the method specialized on NUMBER to be called. Therefore you should only use statically dispatched functions for optimization where each method has the same behaviour just implemented for different types.

NOTE: If the type of an argument cannot be determined, or is declared T, the generic function will not be statically dispatched even if an INLINE declaration is in place.

Another aspect in which the semantics of generic functions are changed is that when dynamically dispatched the list of methods can be changed at runtime, that is new methods can be added while the program is running and existing methods can be removed. Obviously, static-dispatch cannot predict what methods will be added or removed, therefore adding or removing methods will not have the desired effect on statically dispatched generic function calls.

Differences from INLINED-GENERIC-FUNCTION

Inlined-Generic-Function uses a custom generic function metaclass INLINED-GENERIC-FUNCTION which stores the method's body in order for it to be inlined by the compiler-macro. Whilst this approach is more robust than shadowing DEFMETHOD in order to store the method body in a global variable, as it will be able to inline methods added by other means besides DEFMETHOD, the metaclass is changed from the standard generic function metaclass which in turn prevents certain optimizations, of the dynamic generic function dispatch, from being performed by the compiler. This results in slower execution speed, as shown in [https://github.com/guicho271828/inlined-generic-function#user-content-result].

Static-Dispatch does not use a custom generic function metaclass thus generic functions are identical to standard common lisp generic functions, and hence the usual optimizations are performed, unless an INLINE declaration is in place. This only matters when generic functions are not inlined, however the goal of this library is to provide generic function inlining as an optimization for cases where it is known that standard dynamic dispatch is too slow, not to provide inlining by default.

In Static-Dispatch the generic function call form is directly replaced with the body of the most-specific applicable method, whereas in Inlined-Generic-Function the form is replaced with a MATCH form which contains a pattern-matching clause for each method that checks whether the types of the arguments match the method's specializer list and evaluates the body of the method. An advantage of the approach taken by Inlined-Generic-Function is that the method bodies can be inlined even if the arguments are more complicated expressions than variables and THE forms. However this relies on the compiler to remove the clauses corresponding to the non-applicable methods otherwise the result is that dynamic dispatch is still performed, however is performed inline and is potentially slower than the built-in dynamic dispatch of CLOS. SBCL is capable of removing branches, corresponding to non-applicable methods, however most other compilers (including CCL) are not.

Static-Dispatch can handle full lambda-lists with all lambda-list keywords. Inlined-Generic-Function cannot, as of yet (November 2018), handle lambda-lists containing anything but required arguments.

Static-Dispatch does not yet support user-defined method combinations, whereas Inlined-Generic-Function does.

Dependencies

Main Dependencies

closer-mop - Required to obtain information about generic-function methods, namely the argument precedence order and class precedence list.

cl-environments - Used to extract declaration information from environments, on any implementation. Requires that the ENABLE-HOOK function (exported from the STATIC-DISPATCH-CL package) is called.

Other Dependencies

agutil, alexandria, anaphora, trivia, iterate, arrows.

Status

Supports class and EQL specializers.

Does not support user-defined method combinations.

Tested on: CCL, SBCL, CLISP, ECL, CMUCL and ABCL.

Currently generic functions can be statically dispatched successfully on SBCL and CCL without any workarounds. On the remaining listed implementations, generic functions can only be statically dispatched if the CL-ENVIRONMENTS:ENABLE-HOOK function is called prior to compiling the source file, where static dispatch should be performed.

Known Issues:

Planned Future Additions


Next: , Previous: , Up: Top   [Contents][Index]

2 Systems

The main system appears first, followed by any subsystem dependency.


Previous: , Up: Systems   [Contents][Index]

2.1 static-dispatch

Author

Alexander Gutev

License

MIT

Description

Static generic function dispatch for Common Lisp.

Version

0.3

Dependencies
Source

static-dispatch.asd (file)

Component

src (module)


Next: , Previous: , Up: Top   [Contents][Index]

3 Modules

Modules are listed depth-first from the system components tree.


Previous: , Up: Modules   [Contents][Index]

3.1 static-dispatch/src

Parent

static-dispatch (system)

Location

src/

Components

Next: , Previous: , Up: Top   [Contents][Index]

4 Files

Files are sorted by type and then listed depth-first from the systems components trees.


Previous: , Up: Files   [Contents][Index]

4.1 Lisp


Next: , Previous: , Up: Lisp files   [Contents][Index]

4.1.1 static-dispatch.asd

Location

static-dispatch.asd

Systems

static-dispatch (system)


Next: , Previous: , Up: Lisp files   [Contents][Index]

4.1.2 static-dispatch/src/package.lisp

Parent

src (module)

Location

src/package.lisp

Packages

static-dispatch


Previous: , Up: Lisp files   [Contents][Index]

4.1.3 static-dispatch/src/static-dispatch.lisp

Parent

src (module)

Location

src/static-dispatch.lisp

Exported Definitions
Internal Definitions

Next: , Previous: , Up: Top   [Contents][Index]

5 Packages

Packages are listed by definition order.


Previous: , Up: Packages   [Contents][Index]

5.1 static-dispatch

Source

package.lisp (file)

Use List
Exported Definitions
Internal Definitions

Next: , Previous: , Up: Top   [Contents][Index]

6 Definitions

Definitions are sorted by export status, category, package, and then by lexicographic order.


Next: , Previous: , Up: Definitions   [Contents][Index]

6.1 Exported definitions


Next: , Previous: , Up: Exported definitions   [Contents][Index]

6.1.1 Macros

Macro: defgeneric NAME (&rest LAMBDA-LIST) &rest OPTIONS
Package

static-dispatch

Source

static-dispatch.lisp (file)

Macro: defmethod NAME &rest ARGS
Package

static-dispatch

Source

static-dispatch.lisp (file)


Next: , Previous: , Up: Exported definitions   [Contents][Index]

6.1.2 Functions

Function: static-dispatch WHOLE &optional ENV

Compiler macro function for statically dispatched generic functions.

Package

static-dispatch

Source

static-dispatch.lisp (file)


Previous: , Up: Exported definitions   [Contents][Index]

6.1.3 Conditions

Condition: illegal-call-next-method-error ()

Condition representing an illegal call to CALL-NEXT-METHOD from within a :BEFORE and :AFTER method

Package

static-dispatch

Source

static-dispatch.lisp (file)

Direct superclasses

error (condition)

Direct methods
Direct slots
Slot: method-type

The type of method from which CALL-NEXT-METHOD was called.

Initargs

:method-type

Readers

method-type (generic function)

Condition: no-primary-method-error ()

No primary method for a generic function with given arguments.

Package

static-dispatch

Source

static-dispatch.lisp (file)

Direct superclasses

error (condition)

Direct methods
Direct slots
Slot: gf-name

Generic function name.

Initargs

:gf-name

Readers

gf-name (generic function)

Slot: args

Method arguments.

Initargs

:args

Readers

args (generic function)


Previous: , Up: Definitions   [Contents][Index]

6.2 Internal definitions


Next: , Previous: , Up: Internal definitions   [Contents][Index]

6.2.1 Special variables

Special Variable: *current-gf*

The name of the generic function currently being inlined/statically dispatched.

Package

static-dispatch

Source

static-dispatch.lisp (file)

Special Variable: *generic-function-table*

Hash table mapping generic functions to a list of methods.

Package

static-dispatch

Source

static-dispatch.lisp (file)


Next: , Previous: , Up: Internal definitions   [Contents][Index]

6.2.2 Macros

Macro: static-dispatch-test-hook ()

A form of this macro is inserted in the output of the STATIC-DISPATCH compiler macro, in order to allow certain test code to be inserted, by shadowing this macro using MACROLET. The global expands to NIL.

Package

static-dispatch

Source

static-dispatch.lisp (file)


Next: , Previous: , Up: Internal definitions   [Contents][Index]

6.2.3 Functions

Function: applicable-methods METHODS TYPES

Returns a list of all methods in METHODS which are applicable to the types TYPES.

Package

static-dispatch

Source

static-dispatch.lisp (file)

Function: block-name GF-NAME

Returns the name of the implicit block, surrounding a method of the generic function GF-NAME.

Package

static-dispatch

Source

static-dispatch.lisp (file)

Function: enclose-in-type-declarations FORMS VARS TYPES

Encloses FORMS in a LOCALLY form which declares the types of VARS to be TYPES.

Package

static-dispatch

Source

static-dispatch.lisp (file)

Function: ensure-gf-methods GF-NAME

Ensures that a method table for the generic function GF-NAME exists, in *GENERIC-FUNCTION-TABLE*.

Package

static-dispatch

Source

static-dispatch.lisp (file)

Function: ensure-method-info GF-NAME QUALIFIER SPECIALIZERS &key BODY LAMBDA-LIST REMOVE-ON-REDEFINE-P

Ensures that the method table, withing *GENERIC-FUNCTION-TABLE*, of the generic function GF-NAME contains a method with qualifier QUALIFIER, specializers SPECIALIZERS, lambda-list LAMBDA-LIST and body BODY. If the table does not contain a method for those specializers, a new ‘METHOD-INFO’ object is created.

Package

static-dispatch

Source

static-dispatch.lisp (file)

Function: gf-method GF-NAME SPECIALIZERS

Returns the ‘METHOD-INFO’, of the method with specializer list SPECIALIZERS, of the generic function GF-NAME.

Package

static-dispatch

Source

static-dispatch.lisp (file)

Writer

(setf gf-method) (function)

Function: (setf gf-method) VALUE GF-NAME SPECIALIZERS

Sets the method info, to VALUE, for the method with specializer list SPECIALIZERS, of the generic function GF-NAME.

Package

static-dispatch

Source

static-dispatch.lisp (file)

Reader

gf-method (function)

Function: gf-methods GF-NAME

Returns the method information for the generic function GF-NAME. A hash-table mapping lists of specializers to ‘METHOD-INFO’ objects is returned.

Package

static-dispatch

Source

static-dispatch.lisp (file)

Function: has-eql-specializer? SPECIALIZERS

Returns true if SPECIALIZERS contains EQL
specializers. SPECIALIZERS should be the list of specializers extracted from a DEFMETHOD lambda list.

Package

static-dispatch

Source

static-dispatch.lisp (file)

Function: inline-methods METHODS ARGS &optional CHECK-TYPES TYPES

Return a form which contains the body of all the applicable methods (METHODS) inline, starting with the most specific method.

ARGS is either a list of the arguments passed to the methods or a symbol naming a variable in which the argument list is stored.

If CHECK-TYPES is true CHECK-TYPES forms are inserted to check the types of the arguments to CALL-NEXT-METHOD.

TYPES is a list of the argument types, determined from the lexical environment.

Package

static-dispatch

Source

static-dispatch.lisp (file)

Function: make-aux-method-body METHOD ARGS NEXT-METHODS &key CHECK-TYPES TYPES

Return a list of forms containing the bodies of auxiliary (:BEFORE and :AFTER) methods inline.

METHOD is the first method to execute.

ARGS is the list of arguments or the name of the argument list
variable.

NEXT-METHODS is the list of the following methods to be executed.

CHECK-TYPES is a boolean indicating whether CHECK-TYPES forms
should be inserted.

TYPES is the list of the types of the arguments as determined from
the lexical environment.

Package

static-dispatch

Source

static-dispatch.lisp (file)

Function: make-aux-methods TYPE METHOD ARGS NEXT-METHODS &key CHECK-TYPES TYPES

Return a form containing the bodies of auxiliary (:BEFORE and :AFTER) methods inline.

METHOD is the first method to execute.

ARGS is the list of arguments or the name of the argument list
variable.

NEXT-METHODS is the list of the following methods to be executed.

CHECK-TYPES is a boolean indicating whether CHECK-TYPES forms
should be inserted.

TYPES is the list of the types of the arguments as determined from
the lexical environment.

Package

static-dispatch

Source

static-dispatch.lisp (file)

Function: make-ignorable-declarations VARS

Creates a DECLARE IGNORABLE expression for the variables in VARS.

Package

static-dispatch

Source

static-dispatch.lisp (file)

Function: make-inline-method-body METHOD ARGS TYPES CHECK-TYPES

Returns the inline method body (without the CALL-NEXT-METHOD and NEXT-METHOD-P functions), of a METHOD, when applied on arguments ARGS with types TYPES.

Package

static-dispatch

Source

static-dispatch.lisp (file)

Function: make-primary-method-form METHOD ARGS NEXT-METHODS &key CHECK-TYPES TYPES LAST-FORM

Return a form containing the bodies of the primary method inline.

METHOD is the primary method to be executed.

ARGS is the list of arguments or the name of the argument list variable.

NEXT-METHODS is the list of the following applicable primary methods.

CHECK-TYPES is a boolean indicating whether CHECK-TYPES forms should be inserted.

TYPES is the list of the types of the arguments as determined from the lexical environment.

LAST-FORM is a function which is called to generate the body of the CALL-NEXT-METHOD function of the last applicable method. The function is called with one argument, the variable to which the argument list is bound. If LAST-FORM is NIL a call to NO-NEXT-METHOD is generated in the body of the last CALL-NEXT-METHOD function.

Package

static-dispatch

Source

static-dispatch.lisp (file)

Function: make-type-checks VARS TYPES

Returns a list of CHECK-TYPE forms for each variable in VARS and corresponding type in TYPES.

Package

static-dispatch

Source

static-dispatch.lisp (file)

Function: make-type-declarations VARS TYPES

Returns a DECLARE expression which declares each variable in VARS to be of the type stored in the corresponding element of TYPES

Package

static-dispatch

Source

static-dispatch.lisp (file)

Function: mark-no-dispatch GF-NAME

Mark the generic function as one which should not be dispatched statically. This is used primarily when unsupported features are used in the definition of the generic function or its methods.

Package

static-dispatch

Source

static-dispatch.lisp (file)

Function: method< S1 S2

Returns true if method with specializers and qualifier S1 should be called before S2.

Package

static-dispatch

Source

static-dispatch.lisp (file)

Function: order-by-precedence PRECEDENCE ARGS

Orders the list ARGS by the order specified in PRECEDENCE.

Package

static-dispatch

Source

static-dispatch.lisp (file)

Function: order-method-specializers METHODS PRECEDENCE

Orders the specializers of METHODS by the argument precedence order PRECEDENCE.

Package

static-dispatch

Source

static-dispatch.lisp (file)

Function: parse-method ARGS
Package

static-dispatch

Source

static-dispatch.lisp (file)

Function: parse-method-lambda-list LAMBDA-LIST
Package

static-dispatch

Source

static-dispatch.lisp (file)

Function: precedence-order LAMBDA-LIST PRECEDENCE

Returns a list of the generic function arguments in argument precedence order (PRECEDENCE). Each element in the list is the index of the argument within LAMBDA-LIST.

Package

static-dispatch

Source

static-dispatch.lisp (file)

Function: qualifier< Q1 Q2

Returns true if the method with qualifier Q1 should be called before the method with qualifier Q2.

Package

static-dispatch

Source

static-dispatch.lisp (file)

Function: should-check-types ENV

Returns true if CHECK-TYPE forms should be added in the body of CALL-NEXT-METHOD. CHECK-TYPE forms are added if the priority of the SAFETY optimize quality is greater than or equal to the SPEED optimize quality in the environment ENV.

Package

static-dispatch

Source

static-dispatch.lisp (file)

Function: sort-methods METHODS

Sorts METHODS by specificity.

Package

static-dispatch

Source

static-dispatch.lisp (file)

Function: specializer->cl SPECIALIZER

Returns the CL representation of a specializer as used in a DEFMETHOD lambda-list. ‘CLASS’ specializers are replaced with their CLASS-NAME and EQL specializers are replaced with ‘(EQL ,EQL-SPECIALIZER-OBJECT). The EQL-SPECIALIZER-OBJECT is the value to which the EQL object form was evaluated not the form itself.

Package

static-dispatch

Source

static-dispatch.lisp (file)

Function: specializer< S1 S2

Returns true if the specializer list S1 is more specific than specializer list S2.

Package

static-dispatch

Source

static-dispatch.lisp (file)

Function: static-dispatch? NAME ENV

Checks whether the generic function named NAME should be statically dispatched. This is the case if it is declared inline in the environment ENV.

Package

static-dispatch

Source

static-dispatch.lisp (file)

Function: static-overload GF-NAME ARGS ENV

Determines the types of the generic function (with name GF-NAME) arguments ARGS, determines the most applicable method and returns the body of the method. If there are no applicable methods, or the types of the arguments could not be determined, NIL is returned.

Package

static-dispatch

Source

static-dispatch.lisp (file)


Next: , Previous: , Up: Internal definitions   [Contents][Index]

6.2.4 Generic functions

Generic Function: args CONDITION
Package

static-dispatch

Methods
Method: args (CONDITION no-primary-method-error)
Source

static-dispatch.lisp (file)

Generic Function: body OBJECT
Generic Function: (setf body) NEW-VALUE OBJECT
Package

static-dispatch

Methods
Method: body (METHOD-INFO method-info)
Method: (setf body) NEW-VALUE (METHOD-INFO method-info)

The method function body.

Source

static-dispatch.lisp (file)

Generic Function: feature CONDITION
Package

static-dispatch

Methods
Method: feature (CONDITION not-supported)
Source

static-dispatch.lisp (file)

Generic Function: function-name OBJECT
Generic Function: (setf function-name) NEW-VALUE OBJECT
Package

static-dispatch

Methods
Method: function-name (METHOD-INFO method-info)
Method: (setf function-name) NEW-VALUE (METHOD-INFO method-info)

Symbol naming a non-generic function which implements the method.

Source

static-dispatch.lisp (file)

Generic Function: gf-name CONDITION
Package

static-dispatch

Methods
Method: gf-name (CONDITION no-primary-method-error)
Source

static-dispatch.lisp (file)

Generic Function: method-type CONDITION
Package

static-dispatch

Methods
Method: method-type (CONDITION illegal-call-next-method-error)
Source

static-dispatch.lisp (file)

Generic Function: qualifier OBJECT
Generic Function: (setf qualifier) NEW-VALUE OBJECT
Package

static-dispatch

Methods
Method: qualifier (METHOD-INFO method-info)
Method: (setf qualifier) NEW-VALUE (METHOD-INFO method-info)

The method qualifier, NIL for primary methods or :BEFORE, :AFTER, :AROUND for auxiliary methods.

Source

static-dispatch.lisp (file)

Generic Function: remove-on-redefine-p OBJECT
Generic Function: (setf remove-on-redefine-p) NEW-VALUE OBJECT
Package

static-dispatch

Methods
Method: remove-on-redefine-p (METHOD-INFO method-info)
Method: (setf remove-on-redefine-p) NEW-VALUE (METHOD-INFO method-info)

True if the method should be removed when the DEFGENERIC form is re-evaluated.

Source

static-dispatch.lisp (file)

Generic Function: specializers OBJECT
Generic Function: (setf specializers) NEW-VALUE OBJECT
Package

static-dispatch

Methods
Method: specializers (METHOD-INFO method-info)
Method: (setf specializers) NEW-VALUE (METHOD-INFO method-info)

The method’s specializers

Source

static-dispatch.lisp (file)


Next: , Previous: , Up: Internal definitions   [Contents][Index]

6.2.5 Conditions

Condition: not-supported ()

Error condition: A CLOS feature was used that is not supporting in inlining/static dispatch.

Package

static-dispatch

Source

static-dispatch.lisp (file)

Direct superclasses

error (condition)

Direct methods

feature (method)

Direct slots
Slot: feature

Symbol identifying the unsupported feature.

Initargs

:feature

Initform

(quote nil)

Readers

feature (generic function)


Previous: , Up: Internal definitions   [Contents][Index]

6.2.6 Classes

Class: method-info ()

Stores the body of a method and the name of a non-generic function which contains the method’s body.

Package

static-dispatch

Source

static-dispatch.lisp (file)

Direct superclasses

standard-object (class)

Direct methods
Direct slots
Slot: body

The method function body.

Initargs

:body

Readers

body (generic function)

Writers

(setf body) (generic function)

Slot: qualifier

The method qualifier, NIL for primary methods or :BEFORE, :AFTER, :AROUND for auxiliary methods.

Initargs

:qualifier

Readers

qualifier (generic function)

Writers

(setf qualifier) (generic function)

Slot: lambda-list

The lambda-list of the method.

Initargs

:lambda-list

Readers

lambda-list (generic function)

Writers

(setf lambda-list) (generic function)

Slot: specializers

The method’s specializers

Initargs

:specializers

Readers

specializers (generic function)

Writers

(setf specializers) (generic function)

Slot: function-name

Symbol naming a non-generic function which implements the method.

Initargs

:function-name

Readers

function-name (generic function)

Writers

(setf function-name) (generic function)

Slot: remove-on-redefine-p

True if the method should be removed when the DEFGENERIC form is re-evaluated.

Initargs

:remove-on-redefine-p

Readers

remove-on-redefine-p (generic function)

Writers

(setf remove-on-redefine-p) (generic function)


Previous: , Up: Top   [Contents][Index]

Appendix A Indexes


Next: , Previous: , Up: Indexes   [Contents][Index]

A.1 Concepts

Jump to:   F   L   M   S  
Index Entry  Section

F
File, Lisp, static-dispatch.asd: The static-dispatch․asd file
File, Lisp, static-dispatch/src/package.lisp: The static-dispatch/src/package․lisp file
File, Lisp, static-dispatch/src/static-dispatch.lisp: The static-dispatch/src/static-dispatch․lisp file

L
Lisp File, static-dispatch.asd: The static-dispatch․asd file
Lisp File, static-dispatch/src/package.lisp: The static-dispatch/src/package․lisp file
Lisp File, static-dispatch/src/static-dispatch.lisp: The static-dispatch/src/static-dispatch․lisp file

M
Module, static-dispatch/src: The static-dispatch/src module

S
static-dispatch.asd: The static-dispatch․asd file
static-dispatch/src: The static-dispatch/src module
static-dispatch/src/package.lisp: The static-dispatch/src/package․lisp file
static-dispatch/src/static-dispatch.lisp: The static-dispatch/src/static-dispatch․lisp file

Jump to:   F   L   M   S  

Next: , Previous: , Up: Indexes   [Contents][Index]

A.2 Functions

Jump to:   (  
A   B   D   E   F   G   H   I   M   O   P   Q   R   S  
Index Entry  Section

(
(setf body): Internal generic functions
(setf body): Internal generic functions
(setf function-name): Internal generic functions
(setf function-name): Internal generic functions
(setf gf-method): Internal functions
(setf qualifier): Internal generic functions
(setf qualifier): Internal generic functions
(setf remove-on-redefine-p): Internal generic functions
(setf remove-on-redefine-p): Internal generic functions
(setf specializers): Internal generic functions
(setf specializers): Internal generic functions

A
applicable-methods: Internal functions
args: Internal generic functions
args: Internal generic functions

B
block-name: Internal functions
body: Internal generic functions
body: Internal generic functions

D
defgeneric: Exported macros
defmethod: Exported macros

E
enclose-in-type-declarations: Internal functions
ensure-gf-methods: Internal functions
ensure-method-info: Internal functions

F
feature: Internal generic functions
feature: Internal generic functions
Function, (setf gf-method): Internal functions
Function, applicable-methods: Internal functions
Function, block-name: Internal functions
Function, enclose-in-type-declarations: Internal functions
Function, ensure-gf-methods: Internal functions
Function, ensure-method-info: Internal functions
Function, gf-method: Internal functions
Function, gf-methods: Internal functions
Function, has-eql-specializer?: Internal functions
Function, inline-methods: Internal functions
Function, make-aux-method-body: Internal functions
Function, make-aux-methods: Internal functions
Function, make-ignorable-declarations: Internal functions
Function, make-inline-method-body: Internal functions
Function, make-primary-method-form: Internal functions
Function, make-type-checks: Internal functions
Function, make-type-declarations: Internal functions
Function, mark-no-dispatch: Internal functions
Function, method<: Internal functions
Function, order-by-precedence: Internal functions
Function, order-method-specializers: Internal functions
Function, parse-method: Internal functions
Function, parse-method-lambda-list: Internal functions
Function, precedence-order: Internal functions
Function, qualifier<: Internal functions
Function, should-check-types: Internal functions
Function, sort-methods: Internal functions
Function, specializer->cl: Internal functions
Function, specializer<: Internal functions
Function, static-dispatch: Exported functions
Function, static-dispatch?: Internal functions
Function, static-overload: Internal functions
function-name: Internal generic functions
function-name: Internal generic functions

G
Generic Function, (setf body): Internal generic functions
Generic Function, (setf function-name): Internal generic functions
Generic Function, (setf qualifier): Internal generic functions
Generic Function, (setf remove-on-redefine-p): Internal generic functions
Generic Function, (setf specializers): Internal generic functions
Generic Function, args: Internal generic functions
Generic Function, body: Internal generic functions
Generic Function, feature: Internal generic functions
Generic Function, function-name: Internal generic functions
Generic Function, gf-name: Internal generic functions
Generic Function, method-type: Internal generic functions
Generic Function, qualifier: Internal generic functions
Generic Function, remove-on-redefine-p: Internal generic functions
Generic Function, specializers: Internal generic functions
gf-method: Internal functions
gf-methods: Internal functions
gf-name: Internal generic functions
gf-name: Internal generic functions

H
has-eql-specializer?: Internal functions

I
inline-methods: Internal functions

M
Macro, defgeneric: Exported macros
Macro, defmethod: Exported macros
Macro, static-dispatch-test-hook: Internal macros
make-aux-method-body: Internal functions
make-aux-methods: Internal functions
make-ignorable-declarations: Internal functions
make-inline-method-body: Internal functions
make-primary-method-form: Internal functions
make-type-checks: Internal functions
make-type-declarations: Internal functions
mark-no-dispatch: Internal functions
Method, (setf body): Internal generic functions
Method, (setf function-name): Internal generic functions
Method, (setf qualifier): Internal generic functions
Method, (setf remove-on-redefine-p): Internal generic functions
Method, (setf specializers): Internal generic functions
Method, args: Internal generic functions
Method, body: Internal generic functions
Method, feature: Internal generic functions
Method, function-name: Internal generic functions
Method, gf-name: Internal generic functions
Method, method-type: Internal generic functions
Method, qualifier: Internal generic functions
Method, remove-on-redefine-p: Internal generic functions
Method, specializers: Internal generic functions
method-type: Internal generic functions
method-type: Internal generic functions
method<: Internal functions

O
order-by-precedence: Internal functions
order-method-specializers: Internal functions

P
parse-method: Internal functions
parse-method-lambda-list: Internal functions
precedence-order: Internal functions

Q
qualifier: Internal generic functions
qualifier: Internal generic functions
qualifier<: Internal functions

R
remove-on-redefine-p: Internal generic functions
remove-on-redefine-p: Internal generic functions

S
should-check-types: Internal functions
sort-methods: Internal functions
specializer->cl: Internal functions
specializer<: Internal functions
specializers: Internal generic functions
specializers: Internal generic functions
static-dispatch: Exported functions
static-dispatch-test-hook: Internal macros
static-dispatch?: Internal functions
static-overload: Internal functions

Jump to:   (  
A   B   D   E   F   G   H   I   M   O   P   Q   R   S  

Next: , Previous: , Up: Indexes   [Contents][Index]

A.3 Variables

Jump to:   *  
A   B   F   G   L   M   Q   R   S  
Index Entry  Section

*
*current-gf*: Internal special variables
*generic-function-table*: Internal special variables

A
args: Exported conditions

B
body: Internal classes

F
feature: Internal conditions
function-name: Internal classes

G
gf-name: Exported conditions

L
lambda-list: Internal classes

M
method-type: Exported conditions

Q
qualifier: Internal classes

R
remove-on-redefine-p: Internal classes

S
Slot, args: Exported conditions
Slot, body: Internal classes
Slot, feature: Internal conditions
Slot, function-name: Internal classes
Slot, gf-name: Exported conditions
Slot, lambda-list: Internal classes
Slot, method-type: Exported conditions
Slot, qualifier: Internal classes
Slot, remove-on-redefine-p: Internal classes
Slot, specializers: Internal classes
Special Variable, *current-gf*: Internal special variables
Special Variable, *generic-function-table*: Internal special variables
specializers: Internal classes

Jump to:   *  
A   B   F   G   L   M   Q   R   S  

Previous: , Up: Indexes   [Contents][Index]

A.4 Data types

Jump to:   C   I   M   N   P   S  
Index Entry  Section

C
Class, method-info: Internal classes
Condition, illegal-call-next-method-error: Exported conditions
Condition, no-primary-method-error: Exported conditions
Condition, not-supported: Internal conditions

I
illegal-call-next-method-error: Exported conditions

M
method-info: Internal classes

N
no-primary-method-error: Exported conditions
not-supported: Internal conditions

P
Package, static-dispatch: The static-dispatch package

S
static-dispatch: The static-dispatch system
static-dispatch: The static-dispatch package
System, static-dispatch: The static-dispatch system

Jump to:   C   I   M   N   P   S