The closer-mop Reference Manual
Table of Contents
The closer-mop Reference Manual
This is the closer-mop Reference Manual, version 1.0.0,
generated automatically by Declt version 3.0 "Montgomery Scott"
on Tue Dec 22 13:05:10 2020 GMT+0.
1 Introduction
Closer to MOP
Closer to MOP is a compatibility layer that rectifies many of the absent or incorrect CLOS MOP features across a broad range of Common Lisp implementations.
Closer to MOP is also provided by Quicklisp.
Currently, the following Common Lisp implementations are supported:
- Allegro Common Lisp 10.1 Express Edition
- Armed Bear Common Lisp 1.7.1
- CLisp 2.49
- Clozure Common Lisp 1.12
- Embeddable Common Lisp 16.1.3
- LispWorks 7.1.2 Hobbyist Edition
- Steel Bank Common Lisp 2.0.11
The following implementations were supported in the past:
- Allegro Common Lisp 7.0, 8.0 - 8.2 Enterprise Editions
- Allegro Common Lisp 9.0, 10.0 Express Editions
- Armed Bear Common Lisp 1.1.1, 1.2.1, 1.3.0-1.3.3, 1.4.0, 1.5.0, 1.6.0, 1.6.1, 1.7.0
- CLisp from 2.35 onward
- Clozure Common Lisp 1.2 - 1.11, 1.11.5, 1.11.6
- CMU Common Lisp 19c-f, 20a-f, 21a-d
- Embeddable Common Lisp 9.12.3, 10.3.1, 10.4.1, 11.1.1, 12.2.1, 12.12.1, 15.2.21, 15.3.7, 16.0.0, 16.1.2
- LispWorks 4.3 & 4.4, Personal and Professional Editions
- LispWorks 5.0.1, 5.0.2, 5.1.0 - 5.1.2 Personal and Professional Editions
- LispWorks 6.0, 6.0.1 Enterprise Editions
- LispWorks 6.1, 6.1.1, Professional Editions
- LispWorks 6.1.1 Personal Edition
- LispWorks 7.0.0 Hobbyist Edition
- Macintosh Common Lisp 5.1, 5.2.1
- OpenMCL 1.0
- Scieneer Common Lisp 1.3.9
- Steel Bank Common Lisp from 0.9.16 onward (except version 1.0.0)
The respective code conditionalizations are still in the source files, so there is a good chance that they still work, especially for current or newer versions. However, there is no guarantee that this is the case, and active work for these implementations is currently on hold.
New in version 1.0.0:
- New version number based on semantic versioning.
- Since version 0.61, support for Allegro Common Lisp 8.2 & 9.0, ABCL, and LispWorks 6.1 has been added.
- ECL 12.12.1 has seen major improvements in its MOP support, and therefore also in Closer to MOP.
- Several bug fixes.
New in version 0.61:
- Added support for LispWorks 6.0.
Highlights of version 0.6:
- Completely reworked support for Embeddable Common Lisp.
- Resurrected support for Macintosh Common Lisp (now RMCL).
- Added partial support for Scieneer Common Lisp.
- Closer to MOP now recognizes and supports 9 different Common Lisp implementations!
- Added improved and complete generic function invocation protocols to Clozure Common Lisp, CLisp, ECL, LispWorks and SBCL. This includes support for COMPUTE-EFFECTIVE-METHOD-FUNCTION (a piece missing in AMOP) and MAKE-METHOD-LAMBDA in all these implementations (except for ECL, where I currently cannot support MAKE-METHOD-LAMBDA). Note: in order to ensure that MAKE-METHOD-LAMBDA doesn't create surprising results (or better: surprisingly doesn't create the results you expect), it is now ensured that DEFGENERIC creates a generic function metaobject in the compilation environment (without the method definitions), and it is now checked in DEFMETHOD that such a generic function metaobject exists for the method to be defined. If such a generic function metaobject doesn't exist, a STYLE-WARNING is issued (except for SBCL, which itself already issues a STYLE-WARNING in this case).
- The standard metobject definition macros and functions (DEFCLASS, DEFGENERIC, DEFMETHOD, ENSURE-CLASS, ENSURE-GENERIC-FUNCTION, etc.) sometimes forced the use of the replacement 'standard' metaobject classes of Closer to MOP (STANDARD-CLASS, STANDARD-GENERIC-FUNCTION and STANDARD-METHOD). This is now completely removed: If you don't use a :METACLASS or :GENERIC-FUNCTION-CLASS option explicitly, these defining operators will use the internal metaclasses of the respective Common Lisp implementation, under the assumption that they are usually more efficient than the replacements in Closer to MOP. If for some reason, you want to ensure to use the replacements, you have to do so explicitly. (Note: The main purpose of the replacements is to provide a common compatible basis for your own metaobject subclasses, not to be used in their own right.)
- Replaced synchronization statements in Allegro and LispWorks with versions that will be compatible with their future SMP support.
- In LispWorks, automatically generated slot readers and writers now only call SLOT-VALUE-USING-CLASS and (SETF SLOT-VALUE-USING-CLASS) if there are actually definitions available for them. Otherwise, they use the native optimized slot access.
- Simplified and improved conditionalizations for Clozure Common Lisp and LispWorks, and removed mentions of OpenMCL (which was just the old name for Clozure Common Lisp).
- Reorganized the code: Moved all package definitions into one place, moved shared code into one common file, and removed the subfolders per CL implementations. (This is mostly to make the maintainer's job easier.)
- Added an Allegro-specific system definition.
- Lots of small little bug fixes and improvements here and there.
- Extra special thanks to Duane Rettig, Steve Haflich, and Juan Jose Garcia-Ripoll for fixing extra hard bugs in extra short amount of time.
Highlights of version 0.55:
- Added standard-instance-access and funcallable-standard-instance-access to LispWorks, due to popular request.
- Added a utility function subclassp that is sometimes more robust than subtypep (but subtypep should be preferred whenever possible).
Highlights of version 0.5:
- Ensured that a defgeneric form makes a generic function metaobject available in the compile-time environment. Otherwise, defmethod may not yield a method of the correct method metaobject class.
- Removed dependency on lw-compat.
- Added support for compute-discriminating-function in Clozure Common Lisp and OpenMCL, based on code provided by Slava Akhmechet.
- Added a classp predicate, due to Willem Broekema.
Highlights of version 0.4:
- Utility function REQUIRED-ARGS added for collecting the required arguments of a lambda list.
- Utility function ENSURE-FINALIZED added for ensuring that a class metaobject is finalized.
Closer to MOP has an asdf system definition, and is part of Quicklisp, so it should be straightforward to include it in your own projects. The package that exports the relevant symbols is called CLOSER-MOP or short C2MOP.
Note that in some cases, symbols from the underlying MOP implementation or even the underlying COMMON-LISP package are shadowed in Closer to MOP. So if you use the CLOSER-MOP package you may need to shadow-import those symbols. Alternatively, you can use the packages CLOSER-COMMON-LISP and CLOSER-COMMON-LISP-USER that provide the symbols of COMMON-LISP / COMMON-LISP-USER plus the symbols of the CLOS MOP and the necessary shadow-imported symbols.
If symbols from the underlying MOP implementation or the COMMON-LISP package are shadowed in Closer to MOP, if they are names for metaobject classes, they are supposed to be used primarily for subclassing. If in rare cases you want to refer to them directly, please be advised that you may need to make fine-grained distinctions between the original symbols and the shadowed symbols, depending on context. The restrictions in the CLOS MOP specification do not allow for a more convenient solution.
For details on what has or has not been fixed, see the accompanying file features.txt. Please also check the comments that come with the source code.
2 Systems
The main system appears first, followed by any subsystem dependency.
2.1 closer-mop
- Author
Pascal Costanza
- License
MIT-style license
- Description
Closer to MOP is a compatibility layer that rectifies many of the absent or incorrect CLOS MOP features across a broad range of Common Lisp implementations.
- Version
1.0.0
- Source
closer-mop.asd (file)
- Components
-
3 Modules
Modules are listed depth-first from the system components tree.
3.1 closer-mop/implementation
- Dependency
closer-mop-shared.lisp (file)
- Parent
closer-mop (system)
- Location
- Components
-
4 Files
Files are sorted by type and then listed depth-first from the systems
components trees.
4.1 Lisp
4.1.1 closer-mop.asd
- Location
closer-mop.asd
- Systems
closer-mop (system)
4.1.2 closer-mop/closer-mop-packages.lisp
- Parent
closer-mop (system)
- Location
closer-mop-packages.lisp
- Packages
-
4.1.3 closer-mop/closer-mop-shared.lisp
- Dependency
closer-mop-packages.lisp (file)
- Parent
closer-mop (system)
- Location
closer-mop-shared.lisp
- Exported Definitions
-
- Internal Definitions
-
4.1.4 closer-mop/implementation/closer-abcl.lisp
- If Feature
abcl
- Parent
implementation (module)
- Location
closer-abcl.lisp
4.1.5 closer-mop/implementation/closer-allegro.lisp
- If Feature
allegro
- Parent
implementation (module)
- Location
closer-allegro.lisp
4.1.6 closer-mop/implementation/closer-clasp.lisp
- If Feature
clasp
- Parent
implementation (module)
- Location
closer-clasp.lisp
4.1.7 closer-mop/implementation/closer-clisp.lisp
- If Feature
clisp
- Parent
implementation (module)
- Location
closer-clisp.lisp
4.1.8 closer-mop/implementation/closer-clozure.lisp
- If Feature
clozure
- Parent
implementation (module)
- Location
closer-clozure.lisp
4.1.9 closer-mop/implementation/closer-cmu.lisp
- If Feature
cmu
- Parent
implementation (module)
- Location
closer-cmu.lisp
4.1.10 closer-mop/implementation/closer-ecl.lisp
- If Feature
ecl
- Parent
implementation (module)
- Location
closer-ecl.lisp
4.1.11 closer-mop/implementation/closer-lispworks.lisp
- If Feature
lispworks
- Parent
implementation (module)
- Location
closer-lispworks.lisp
4.1.12 closer-mop/implementation/closer-mcl.lisp
- If Feature
mcl
- Parent
implementation (module)
- Location
closer-mcl.lisp
4.1.13 closer-mop/implementation/closer-mezzano.lisp
- If Feature
mezzano
- Parent
implementation (module)
- Location
closer-mezzano.lisp
4.1.14 closer-mop/implementation/closer-sbcl.lisp
- If Feature
sbcl
- Parent
implementation (module)
- Location
closer-sbcl.lisp
4.1.15 closer-mop/implementation/closer-scl.lisp
- If Feature
scl
- Parent
implementation (module)
- Location
closer-scl.lisp
5 Packages
Packages are listed by definition order.
5.1 closer-common-lisp
- Source
closer-mop-packages.lisp (file)
- Nickname
c2cl
- Used By List
closer-common-lisp-user
5.2 closer-mop
- Source
closer-mop-packages.lisp (file)
- Nickname
c2mop
- Use List
common-lisp
- Exported Definitions
-
- Internal Definitions
-
5.3 closer-common-lisp-user
- Source
closer-mop-packages.lisp (file)
- Nickname
c2cl-user
- Use List
closer-common-lisp
6 Definitions
Definitions are sorted by export status, category, package, and then by
lexicographic order.
6.1 Exported definitions
6.1.1 Symbol macros
- Symbol Macro: warn-on-defmethod-without-generic-function
-
- Package
closer-mop
- Source
closer-mop-shared.lisp (file)
- Expansion
nil
6.1.2 Macros
- Macro: defgeneric NAME (&rest ARGS) &body OPTIONS
-
- Package
closer-mop
- Source
closer-mop-shared.lisp (file)
- Macro: defmethod NAME &body BODY
-
- Package
closer-mop
- Source
closer-mop-shared.lisp (file)
6.1.3 Functions
- Function: ensure-finalized CLASS &optional ERRORP
-
- Package
closer-mop
- Source
closer-mop-shared.lisp (file)
- Function: ensure-method GF LAMBDA-EXPRESSION &key METHOD-CLASS QUALIFIERS LAMBDA-LIST SPECIALIZERS
-
- Package
closer-mop
- Source
closer-mop-shared.lisp (file)
- Function: fix-slot-initargs INITARGS
-
- Package
closer-mop
- Source
closer-mop-shared.lisp (file)
- Function: required-args LAMBDA-LIST &optional COLLECTOR
-
- Package
closer-mop
- Source
closer-mop-shared.lisp (file)
- Function: subclassp CLASS SUPERCLASS
-
- Package
closer-mop
- Source
closer-mop-shared.lisp (file)
6.1.4 Generic functions
- Generic Function: compute-effective-method-function GF EFFECTIVE-METHOD OPTIONS
-
- Package
closer-mop
- Source
closer-mop-shared.lisp (file)
- Methods
- Method: compute-effective-method-function (GF generic-function) EFFECTIVE-METHOD OPTIONS
-
6.1.5 Classes
- Class: standard-generic-function ()
-
- Package
closer-mop
- Source
closer-mop-shared.lisp (file)
- Direct superclasses
standard-generic-function (class)
- Direct methods
- compute-discriminating-function (method)
- make-method-lambda (method)
6.2 Internal definitions
6.2.1 Special variables
- Special Variable: *standard-gfs*
-
- Package
closer-mop
- Source
closer-mop-shared.lisp (file)
- Special Variable: *standard-slot-keys*
-
- Package
closer-mop
- Source
closer-mop-shared.lisp (file)
6.2.2 Compiler macros
- Compiler Macro: m-function M
-
- Package
closer-mop
- Source
closer-mop-shared.lisp (file)
6.2.3 Functions
- Function: block-name FUNCTION-NAME
-
- Package
closer-mop
- Source
closer-mop-shared.lisp (file)
- Function: compute-argument-order GF NOF-REQUIRED-ARGS
-
- Package
closer-mop
- Source
closer-mop-shared.lisp (file)
- Function: compute-discriminator GF COMPUTE-NATIVE-DISCRIMINATOR
-
- Package
closer-mop
- Source
closer-mop-shared.lisp (file)
- Function: get-emf GF ARGS NOF-REQUIRED-ARGS
-
- Package
closer-mop
- Source
closer-mop-shared.lisp (file)
- Function: get-emf-using-classes GF ARGS CLASSES NOF-REQUIRED-ARGS
-
- Package
closer-mop
- Source
closer-mop-shared.lisp (file)
- Function: m-function M
-
- Package
closer-mop
- Source
closer-mop-shared.lisp (file)
- Function: methods-all-the-same-specializers GF
-
- Package
closer-mop
- Source
closer-mop-shared.lisp (file)
- Function: only-standard-methods GF &rest OTHER-GFS
-
- Package
closer-mop
- Source
closer-mop-shared.lisp (file)
- Function: parse-method-body BODY ERROR-FORM
-
- Package
closer-mop
- Source
closer-mop-shared.lisp (file)
6.2.4 Generic functions
- Generic Function: dwg-name CONDITION
-
- Package
closer-mop
- Methods
- Method: dwg-name (CONDITION defmethod-without-generic-function)
-
- Source
closer-mop-shared.lisp (file)
6.2.5 Conditions
- Condition: defmethod-without-generic-function ()
-
- Package
closer-mop
- Source
closer-mop-shared.lisp (file)
- Direct superclasses
style-warning (condition)
- Direct methods
dwg-name (method)
- Direct slots
- Slot: name
-
- Initargs
:name
- Readers
dwg-name (generic function)
Appendix A Indexes
A.1 Concepts
| Index Entry | | Section |
|
C | | |
| closer-mop.asd: | | The closer-mop․asd file |
| closer-mop/closer-mop-packages.lisp: | | The closer-mop/closer-mop-packages․lisp file |
| closer-mop/closer-mop-shared.lisp: | | The closer-mop/closer-mop-shared․lisp file |
| closer-mop/implementation: | | The closer-mop/implementation module |
| closer-mop/implementation/closer-abcl.lisp: | | The closer-mop/implementation/closer-abcl․lisp file |
| closer-mop/implementation/closer-allegro.lisp: | | The closer-mop/implementation/closer-allegro․lisp file |
| closer-mop/implementation/closer-clasp.lisp: | | The closer-mop/implementation/closer-clasp․lisp file |
| closer-mop/implementation/closer-clisp.lisp: | | The closer-mop/implementation/closer-clisp․lisp file |
| closer-mop/implementation/closer-clozure.lisp: | | The closer-mop/implementation/closer-clozure․lisp file |
| closer-mop/implementation/closer-cmu.lisp: | | The closer-mop/implementation/closer-cmu․lisp file |
| closer-mop/implementation/closer-ecl.lisp: | | The closer-mop/implementation/closer-ecl․lisp file |
| closer-mop/implementation/closer-lispworks.lisp: | | The closer-mop/implementation/closer-lispworks․lisp file |
| closer-mop/implementation/closer-mcl.lisp: | | The closer-mop/implementation/closer-mcl․lisp file |
| closer-mop/implementation/closer-mezzano.lisp: | | The closer-mop/implementation/closer-mezzano․lisp file |
| closer-mop/implementation/closer-sbcl.lisp: | | The closer-mop/implementation/closer-sbcl․lisp file |
| closer-mop/implementation/closer-scl.lisp: | | The closer-mop/implementation/closer-scl․lisp file |
|
F | | |
| File, Lisp, closer-mop.asd: | | The closer-mop․asd file |
| File, Lisp, closer-mop/closer-mop-packages.lisp: | | The closer-mop/closer-mop-packages․lisp file |
| File, Lisp, closer-mop/closer-mop-shared.lisp: | | The closer-mop/closer-mop-shared․lisp file |
| File, Lisp, closer-mop/implementation/closer-abcl.lisp: | | The closer-mop/implementation/closer-abcl․lisp file |
| File, Lisp, closer-mop/implementation/closer-allegro.lisp: | | The closer-mop/implementation/closer-allegro․lisp file |
| File, Lisp, closer-mop/implementation/closer-clasp.lisp: | | The closer-mop/implementation/closer-clasp․lisp file |
| File, Lisp, closer-mop/implementation/closer-clisp.lisp: | | The closer-mop/implementation/closer-clisp․lisp file |
| File, Lisp, closer-mop/implementation/closer-clozure.lisp: | | The closer-mop/implementation/closer-clozure․lisp file |
| File, Lisp, closer-mop/implementation/closer-cmu.lisp: | | The closer-mop/implementation/closer-cmu․lisp file |
| File, Lisp, closer-mop/implementation/closer-ecl.lisp: | | The closer-mop/implementation/closer-ecl․lisp file |
| File, Lisp, closer-mop/implementation/closer-lispworks.lisp: | | The closer-mop/implementation/closer-lispworks․lisp file |
| File, Lisp, closer-mop/implementation/closer-mcl.lisp: | | The closer-mop/implementation/closer-mcl․lisp file |
| File, Lisp, closer-mop/implementation/closer-mezzano.lisp: | | The closer-mop/implementation/closer-mezzano․lisp file |
| File, Lisp, closer-mop/implementation/closer-sbcl.lisp: | | The closer-mop/implementation/closer-sbcl․lisp file |
| File, Lisp, closer-mop/implementation/closer-scl.lisp: | | The closer-mop/implementation/closer-scl․lisp file |
|
L | | |
| Lisp File, closer-mop.asd: | | The closer-mop․asd file |
| Lisp File, closer-mop/closer-mop-packages.lisp: | | The closer-mop/closer-mop-packages․lisp file |
| Lisp File, closer-mop/closer-mop-shared.lisp: | | The closer-mop/closer-mop-shared․lisp file |
| Lisp File, closer-mop/implementation/closer-abcl.lisp: | | The closer-mop/implementation/closer-abcl․lisp file |
| Lisp File, closer-mop/implementation/closer-allegro.lisp: | | The closer-mop/implementation/closer-allegro․lisp file |
| Lisp File, closer-mop/implementation/closer-clasp.lisp: | | The closer-mop/implementation/closer-clasp․lisp file |
| Lisp File, closer-mop/implementation/closer-clisp.lisp: | | The closer-mop/implementation/closer-clisp․lisp file |
| Lisp File, closer-mop/implementation/closer-clozure.lisp: | | The closer-mop/implementation/closer-clozure․lisp file |
| Lisp File, closer-mop/implementation/closer-cmu.lisp: | | The closer-mop/implementation/closer-cmu․lisp file |
| Lisp File, closer-mop/implementation/closer-ecl.lisp: | | The closer-mop/implementation/closer-ecl․lisp file |
| Lisp File, closer-mop/implementation/closer-lispworks.lisp: | | The closer-mop/implementation/closer-lispworks․lisp file |
| Lisp File, closer-mop/implementation/closer-mcl.lisp: | | The closer-mop/implementation/closer-mcl․lisp file |
| Lisp File, closer-mop/implementation/closer-mezzano.lisp: | | The closer-mop/implementation/closer-mezzano․lisp file |
| Lisp File, closer-mop/implementation/closer-sbcl.lisp: | | The closer-mop/implementation/closer-sbcl․lisp file |
| Lisp File, closer-mop/implementation/closer-scl.lisp: | | The closer-mop/implementation/closer-scl․lisp file |
|
M | | |
| Module, closer-mop/implementation: | | The closer-mop/implementation module |
|
A.2 Functions
| Index Entry | | Section |
|
B | | |
| block-name : | | Internal functions |
|
C | | |
| Compiler Macro, m-function : | | Internal compiler macros |
| compute-argument-order : | | Internal functions |
| compute-discriminator : | | Internal functions |
| compute-effective-method-function : | | Exported generic functions |
| compute-effective-method-function : | | Exported generic functions |
|
D | | |
| defgeneric : | | Exported macros |
| defmethod : | | Exported macros |
| dwg-name : | | Internal generic functions |
| dwg-name : | | Internal generic functions |
|
E | | |
| ensure-finalized : | | Exported functions |
| ensure-method : | | Exported functions |
|
F | | |
| fix-slot-initargs : | | Exported functions |
| Function, block-name : | | Internal functions |
| Function, compute-argument-order : | | Internal functions |
| Function, compute-discriminator : | | Internal functions |
| Function, ensure-finalized : | | Exported functions |
| Function, ensure-method : | | Exported functions |
| Function, fix-slot-initargs : | | Exported functions |
| Function, get-emf : | | Internal functions |
| Function, get-emf-using-classes : | | Internal functions |
| Function, m-function : | | Internal functions |
| Function, methods-all-the-same-specializers : | | Internal functions |
| Function, only-standard-methods : | | Internal functions |
| Function, parse-method-body : | | Internal functions |
| Function, required-args : | | Exported functions |
| Function, subclassp : | | Exported functions |
|
G | | |
| Generic Function, compute-effective-method-function : | | Exported generic functions |
| Generic Function, dwg-name : | | Internal generic functions |
| get-emf : | | Internal functions |
| get-emf-using-classes : | | Internal functions |
|
M | | |
| m-function : | | Internal compiler macros |
| m-function : | | Internal functions |
| Macro, defgeneric : | | Exported macros |
| Macro, defmethod : | | Exported macros |
| Method, compute-effective-method-function : | | Exported generic functions |
| Method, dwg-name : | | Internal generic functions |
| methods-all-the-same-specializers : | | Internal functions |
|
O | | |
| only-standard-methods : | | Internal functions |
|
P | | |
| parse-method-body : | | Internal functions |
|
R | | |
| required-args : | | Exported functions |
|
S | | |
| subclassp : | | Exported functions |
|
A.3 Variables
A.4 Data types