features.txt 14.4 KB
Newer Older
Pascal Costanza's avatar
Pascal Costanza committed
1
2
Features that don't adhere to AMOP in various CLOS MOP implementations, and whether and how they are resolved in Closer to MOP.

3
4
5
6
7
8
9
10
Allegro Common Lisp 8.1

- CLASS-DIRECT-DEFAULT-INITARGS and CLASS-DEFAULT-INITARGS don't return canonicalized default initargs as specified. Not fixed.
- COMPUTE-DEFAULT-INITARGS takes more parameters than specified. Not fixed. Conditionalize on #+allegro for your own methods instead.
- FUNCALLABLE-STANDARD-OBJECT is not used as the default superclass for classes with :metaclass FUNCALLABLE-STANDARD-CLASS.
- DEFGENERIC does not call FIND-METHOD-COMBINATION. Not fixed.
- DEFMETHOD doesn't call MAKE-METHOD-LAMBDA. Not fixed.
- The dependent protocol for generic functions doesn't work fully. Fixed.
Pascal Costanza's avatar
Pascal Costanza committed
11
- GENERIC-FUNCTION-ARGUMENT-PRECEDENCE-ORDER doesn't return only the required arguments. Fixed.
12
13
14
15
16
17
18
19
20
21
22
- The function invocation protocol doesn't call COMPUTE-APPLICABLE-METHODS, COMPUTE-APPLICABLE-METHODS-USING-CLASSES and COMPUTE-EFFECTIVE-METHOD. Not fixed.
- The :ALLOCATION type cannot be extended. Fixed.
- MAKE-METHOD-LAMBDA is not provided. Not fixed.
- Method functions don't take parameters as specified in AMOP, but instead just the parameters that the generic function receives. Not fixed.
- REINITIALIZE-INSTANCE doesn't determine a new discriminating function. Fixed.
- (SETF CLASS-NAME) and (SETF GENERIC-FUNCTION-NAME) do not use REINITIALIZE-INSTANCE for changing the names. Not fixed.
- SLOT-MAKUNBOUND-USING-CLASS is not specialized on slot definition metaobjects, but on symbols. Fixed.
- STANDARD-CLASS and FUNCALLABLE-STANDARD-CLASS are not compatible. Not fixed.
- VALIDATE-SUPERCLASS doesn't recognize T as a valid superclass. Not fixed.
- Subclasses of BUILT-IN-CLASS, FORWARD-REFERENCED-CLASS, FUNCALLABLE-STANDARD-CLASS, METHOD-COMBINATION, STANDARD-ACCESSOR-METHOD, STANDARD-CLASS, STANDARD-DIRECT-SLOT-DEFINITION, STANDARD-EFFECTIVE-SLOT-DEFINITION, STANDARD-GENERIC-FUNCTION, STANDARD-METHOD, STANDARD-READER-METHOD, STANDARD-SLOT-DEFINITION and STANDARD-WRITER-METHOD will inherit slots whose names are exported symbols and/or accessible in the package common-lisp-user. Not fixed.

23
CLisp 2.48
Pascal Costanza's avatar
Pascal Costanza committed
24
25
26
27
28
29
30
31
32

None of the incompatibilities in CLisp are fixed.

- Methods are not initialized with :function.
- ADD-METHOD, REMOVE-METHOD, INITIALIZE-INSTANCE and REINITIALIZE-INSTANCE do not determine a new discriminating function. This is postponed until function invocation instead, so shouldn't be a problem in practice.
- The slot order requested by a primary method for COMPUTE-SLOTS is not honoured by this MOP.
- DEFMETHOD does not call MAKE-METHOD-LAMBDA.
- A FORWARD-REFERENCED-CLASS is not changed via CHANGE-CLASS (but is correctly reinitialized via REINITIALIZE-INSTANCE).
- MAKE-METHOD-LAMBDA is not provided.
33
- Subclasses of METHOD-COMBINATION will inherit slots whose names are exported symbols and/or accessible in the package common-lisp-user. Not fixed.
Pascal Costanza's avatar
Pascal Costanza committed
34

35
Clozure Common Lisp 1.3
36

37
In CCL, generic functions work completely differently than specified. The specific incompatibilities are not listed and are not fixed. However, there is now experimental support for compute-discriminating-function, which will automatically be called and whose result will be installed on initialize-instance, reinitialize-instance, add-method and remove-method.
38
39
40
41
42
43

- The slot order requested by a primary method for COMPUTE-SLOTS is not honoured by this MOP. Not fixed.
- DOCUMENTATION doesn't return the documentation strings for slot definition metaobjects. Fixed.
- REINITIALIZE-INSTANCE of a class metaobject doesn't invoke FINALIZE-INHERITANCE again. Not fixed.
- Subclasses of DIRECT-SLOT-DEFINITION, EFFECTIVE-SLOT-DEFINITION, GENERIC-FUNCTION, SLOT-DEFINITION, STANDARD-ACCESSOR-METHOD, STANDARD-DIRECT-SLOT-DEFINITION, STANDARD-EFFECTIVE-SLOT-DEFINITION, STANDARD-GENERIC-FUNCTION, STANDARD-METHOD, STANDARD-READER-METHOD, STANDARD-SLOT-DEFINITION and STANDARD-WRITER-METHOD will inherit slots whose names are exported symbols and/or accessible in the package common-lisp-user. Not fixed.

44
CMUCL 20a
Pascal Costanza's avatar
Pascal Costanza committed
45

46
- CLASS-DIRECT-DEFAULT-INITARGS and CLASS-DEFAULT-INITARGS don't return canonicalized default initargs as specified. Not fixed.
Pascal Costanza's avatar
Pascal Costanza committed
47
48
49
- Accessor methods are not initialized with :function, :lambda-list, :slot-definition and :specializers. Fixed.
- Classes cannot be anonymous. Fixed.
- Class initialization doesn't call READER-METHOD-CLASS and WRITER-METHOD-CLASS for accessor methods. Fixed.
50
- The object returned by compute-discriminating-function cannot be a closure. Likewise, the second parameter to set-funcallable-instance-function cannot be a closure, but only a "pure" function/thunk. Not fixed.
Pascal Costanza's avatar
Pascal Costanza committed
51
- Effective slot definitions are not initialized with :documentation, and EFFECTIVE-SLOT-DEFINITION-CLASS also doesn't receive that initarg. Not fixed.
52
- Calling DOCUMENTATION on effective slot definition metaobjects don't return their documentation as specified in ANSI Common Lisp. Fixed.
Pascal Costanza's avatar
Pascal Costanza committed
53
54
55
- Methods are not initialized with :function. Not fixed.
- Multiple slot options are not passed as lists to DIRECT-SLOT-DEFINITION-CLASS. Not fixed, but use FIX-SLOT-INITARGS as a workaround.
- REINITIALIZE-INSTANCE doesn't determine a new discriminating function. Fixed.
56
- REINITIALIZE-INSTANCE of a class metaobject doesn't invoke FINALIZE-INHERITANCE again. Not fixed.
Pascal Costanza's avatar
Pascal Costanza committed
57
58
- (SETF CLASS-NAME) and (SETF GENERIC-FUNCTION-NAME) do not use REINITIALIZE-INSTANCE for changing the names. Fixed.
- STANDARD-CLASS and FUNCALLABLE-STANDARD-CLASS are not compatible. Not fixed.
59
- Subclasses of BUILT-IN-CLASS, CLASS, DIRECT-SLOT-DEFINITION, EFFECTIVE-SLOT-DEFINITION, EQL-SPECIALIZER, FORWARD-REFERENCED-CLASS, FUNCALLABLE-STANDARD-CLASS, SLOT-DEFINITION, SPECIALIZER, STANDARD-ACCESSOR-METHOD, STANDARD-CLASS, STANDARD-DIRECT-SLOT-DEFINITION, STANDARD-EFFECTIVE-SLOT-DEFINITION, STANDARD-GENERIC-FUNCTION, STANDARD-METHOD, STANDARD-READER-METHOD, STANDARD-SLOT-DEFINITION and STANDARD-WRITER-METHOD will inherit slots whose names are exported symbols and/or accessible in the package common-lisp-user. Not fixed.
Pascal Costanza's avatar
Pascal Costanza committed
60

61
LispWorks, 5.0 - 5.0.2, 5.1, 5.1.2 Personal & Professional Edition
62

63
- CLASS-DIRECT-DEFAULT-INITARGS and CLASS-DEFAULT-INITARGS don't return canonicalized default initargs as specified. Not fixed.
64
65
66
67
68
- ADD-METHOD, REMOVE-METHOD, INITIALIZE-INSTANCE and REINITIALIZE-INSTANCE do not determine a new discriminating function. This is postponed until function invocation instead, so shouldn't be a problem in practice.
- COMPUTE-APPLICABLE-METHODS-USING-CLASSES doesn't exist. Not fixed.
- COMPUTE-DEFAULT-INITARGS doesn't exist. Not fixed.
- DEFGENERIC does not call FIND-METHOD-COMBINATION. Not fixed.
- EQL-SPECIALIZER, EQL-SPECIALIZER-OBJECT and INTERN-EQL-SPECIALIZER don't exist. In LispWorks, eql specializers are lists not objects. I have provided EQL-SPECIALIZER as a type (not as a class) and EQL-SPECIALIZER-OBJECT and INTERN-EQL-SPECIALIZER to work on lists, and a class EQL-SPECIALIZER* and corresponding EQL-SPECIALIZER-OBJECT* and INTERN-EQL-SPECILAIZER* to soften the incompatibilities.
69
- Before LispWorks 5.1, the :ALLOCATION type cannot be extended. Not fixed.
70
71
72
73
74
75
76
77
78
79
- FIND-METHOD-COMBINATION doesn't exist. Fixed, but fixed version doesn't work with method combination options.
- FUNCALLABLE-STANDARD-INSTANCE-ACCESS and STANDARD-INSTANCE-ACCESS don't exist. Not fixed.
- The function invocation protocol doesn't call COMPUTE-APPLICABLE-METHODS and COMPUTE-APPLICABLE-METHODS-USING-CLASSES. Not fixed.
- MAKE-METHOD-LAMBDA expects other parameters than specified. Fixed.
- Method functions don't take parameters as specified in AMOP, but instead just the parameters that the generic function receives. Not fixed.
- The slot methods (SLOT-VALUE-USING-CLASS, etc.) are not specialized on effective slot definitions, but on slot names. Fixed.
- The generated accessor methods don't use the slot methods for accessing slots. Fixed. (Don't use :optimize-slot-access to deoptimize slot access, or otherwise the fixed slot access protocol doesn't work anymore!)
- SPECIALIZER doesn't exist. Not fixed.
- SPECIALIZER-DIRECT-GENERIC-FUNCTIONS doesn't exist. Fixed.
- STANDARD-CLASS and FUNCALLABLE-STANDARD-CLASS are not compatible. Not fixed.
80
- Subclasses of BUILT-IN-CLASS (fixed), CLASS (fixed), DIRECT-SLOT-DEFINITION, EFFECTIVE-SLOT-DEFINITION, FORWARD-REFERENCED-CLASS (fixed), FUNCALLABLE-STANDARD-CLASS (fixed), SLOT-DEFINITION, STANDARD-ACCESSOR-METHOD, STANDARD-CLASS (fixed), STANDARD-DIRECT-SLOT-DEFINITION, STANDARD-EFFECTIVE-SLOT-DEFINITION, STANDARD-GENERIC-FUNCTION, STANDARD-METHOD, STANDARD-READER-METHOD, STANDARD-SLOT-DEFINITION and STANDARD-WRITER-METHOD will inherit slots whose names are exported symbols and/or accessible in the package common-lisp-user. Not fixed, except where indicated otherwise.
81
82


Pascal Costanza's avatar
Pascal Costanza committed
83
84
85
86
MCL 5.1

In MCL, generic functions work completely differently than specified. The specific incompatibilities are not listed and are not fixed.

87
- The slot order requested by a primary method for COMPUTE-SLOTS is not honoured by this MOP. Not fixed.
Pascal Costanza's avatar
Pascal Costanza committed
88
89
- DIRECT-SLOT-DEFINITION, EFFECTIVE-SLOT-DEFINITION, EQL-SPECIALIZER, SLOT-DEFINITION and STANDARD-SLOT-DEFINITION are not exported. Fixed.
- When classes are initialized, :direct-superclasses are by default not empty. Not fixed, but direct superclasses are automatically adjusted when you use the standard idiom for adding a new default superclass.
90
- The :ALLOCATION type cannot be extended. Not fixed.
Pascal Costanza's avatar
Pascal Costanza committed
91
92
- Multiple slot options are not passed as lists to DIRECT-SLOT-DEFINITION-CLASS. Not fixed, but use FIX-SLOT-INITARGS as a workaround.
- (SETF CLASS-NAME) doesn't use REINITIALIZE-INSTANCE for changing the names. Fixed.
93
- REINITIALIZE-INSTANCE of a class metaobject doesn't invoke FINALIZE-INHERITANCE again. Not fixed.
94
- Subclasses of DIRECT-SLOT-DEFINITION, EFFECTIVE-SLOT-DEFINITION, SLOT-DEFINITION, STANDARD-ACCESSOR-METHOD, STANDARD-DIRECT-SLOT-DEFINITION, STANDARD-EFFECTIVE-SLOT-DEFINITION, STANDARD-GENERIC-FUNCTION, STANDARD-METHOD, STANDARD-READER-METHOD, STANDARD-SLOT-DEFINITION and STANDARD-WRITER-METHOD will inherit slots whose names are exported symbols and/or accessible in the package common-lisp-user. Not fixed.
Pascal Costanza's avatar
Pascal Costanza committed
95

96
OpenMCL 1.0
Pascal Costanza's avatar
Pascal Costanza committed
97

98
In OpenMCL, generic functions work completely differently than specified. The specific incompatibilities are not listed and are not fixed. However, there is now experimental support for compute-discriminating-function, which will automatically be called and whose result will be installed on initialize-instance, reinitialize-instance, add-method and remove-method.
Pascal Costanza's avatar
Pascal Costanza committed
99

100
- The slot order requested by a primary method for COMPUTE-SLOTS is not honoured by this MOP. Not fixed.
Pascal Costanza's avatar
Pascal Costanza committed
101
- EQL-SPECIALIZER is not exported. Fixed.
102
- DOCUMENTATION doesn't return the documentation strings for slot definition metaobjects. Fixed.
103
- REINITIALIZE-INSTANCE of a class metaobject doesn't invoke FINALIZE-INHERITANCE again. Not fixed.
104
- Subclasses of DIRECT-SLOT-DEFINITION, EFFECTIVE-SLOT-DEFINITION, GENERIC-FUNCTION, SLOT-DEFINITION, STANDARD-ACCESSOR-METHOD, STANDARD-DIRECT-SLOT-DEFINITION, STANDARD-EFFECTIVE-SLOT-DEFINITION, STANDARD-GENERIC-FUNCTION, STANDARD-METHOD, STANDARD-READER-METHOD, STANDARD-SLOT-DEFINITION and STANDARD-WRITER-METHOD will inherit slots whose names are exported symbols and/or accessible in the package common-lisp-user. Not fixed.
Pascal Costanza's avatar
Pascal Costanza committed
105

106
SBCL 1.0.31
Pascal Costanza's avatar
Pascal Costanza committed
107

108
All features implemented.
109
110


Pascal Costanza's avatar
Pascal Costanza committed
111
112
Summary:

113
- CLASS-DIRECT-DEFAULT-INITARGS and CLASS-DEFAULT-INITARGS exist, but don't work as expected in Allegro Common Lisp, CMUCL and LispWorks.
Pascal Costanza's avatar
Pascal Costanza committed
114
- If you specialize COMPUTE-DEFAULT-INITAGS, conditionalize for the extra parameters in Allegro Common Lisp.
115
- In Allegro Common Lisp, FUNCALLABLE-STANDARD-OBJECT is not used as the default superclass for classes with :metaclass FUNCALLABLE-STANDARD-CLASS.
116
- In CMUCL, the object returned by compute-discriminating-function cannot be a closure. Likewise, the second parameter to set-funcallable-instance-function cannot be a closure, but only a "pure" function/thunk.
117
- In CLisp, Clozure CL, MCL, OpenMCL, the slot order requested by a primary method for COMPUTE-SLOTS is not honoured by the respective MOPs.
Pascal Costanza's avatar
Pascal Costanza committed
118
119
120
121
- Don't rely on FIND-METHOD-COMBINATION to do its job correctly, only when you don't provide method combination options.
- MAKE-METHOD-LAMBDA only works in CMUCL and SBCL as specified (but make sure that the respective generic function and method metaobject classes and make-method-lambda definitions are part of your compilation enviroment). MAKE-METHOD-LAMBDA also works in LispWorks, but the returned lambda expressions don't adhere to the AMOP specification (which may be good enough for your purposes).
- Specialize the methods for the dependent protocol on the class or generic function metaobject class. The example in AMOP doesn't do this but that is fragile code.
- Don't rely on methods being initialized with the specified initargs from inside the MOP.
122
123
- CLisp doesn't change a FORWARD-REFERENCED-CLASS via CHANGE-CLASS.
- Effective slot definitions and EFFECTIVE-SLOT-DEFINITION-CLASS don't receive :documentation in CMUCL.
Pascal Costanza's avatar
Pascal Costanza committed
124
- If you specialize DIRECT-SLOT-DEFINITION-CLASS, use FIX-SLOT-INITARGS in portable code.
125
- If you want to use :ALLOCATION types other than :CLASS or :INSTANCE, you cannot use LispWorks before version 5.1, or MCL. Allegro Common Lisp, CLisp, Clozure CL, CMUCL, LispWorks 5.1, OpenMCL and SBCL support this.
126
- In Allegro, CMUCL and LispWorks, STANDARD-CLASS and FUNCALLABLE-STANDARD-CLASS are not compatible.
Pascal Costanza's avatar
Pascal Costanza committed
127
128
129
130
- The function invocation protocol only works in CMUCL, SBCL and CLisp.
- COMPUTE-DEFAULT-INITARGS doesn't exist (and isn't called) in LispWorks.
- In LispWorks, eql specializers are lists.
- FUNCALLABLE-STANDARD-INSTANCE-ACCESS and STANDARD-INSTANCE-ACCESS doesn't exist / should not be used in LispWorks.
131
- In Clozure CL, CMUCL, MCL and OpenMCL, the reinitialization of a class metaobject does not lead to a call of FINALIZE-INHERITANCE, so methods defined on FINALIZE-INHERITANCE won't be called again in that case.
132
- AMOP specifies that :declarations is used whereas ANSI Common Lisp specifies that 'declare is used. Since all MOP implementations adhere to AMOP in this regard, I have also chosen that path.
Pascal Costanza's avatar
Pascal Costanza committed
133
- In Allegro Common Lisp and LispWorks, method functions take the original parameters that a generic function has received.
134
- If you need to rely on the generic function protocols, don't use Clozure CL, MCL or OpenMCL (or be very careful - some minor things work there as specified).
135
- The declarations for a generic function cannot be inspected in MCL.
136
- All implementations define slots on various specified metaobject classes that are exported from some package and/or accessible in the package common-lisp-user. Only SBCL is safe from this, and clisp is relatively safe in that it does that only for the class METHOD-COMBINATION.