* SB-SIMPLE-STREAMS enhancement: simple-streams can now be used as
streams for the REPL, for the debugger, and so on. (thanks to
David Licteblau)
+ * DEFINE-CODITION is more efficient. (thanks to Brian Mastenbrook)
* fixed some bugs revealed by Paul Dietz' test suite:
** the value of the :REHASH-THRESHOLD argument to MAKE-HASH-TABLE
is ignored if it is too small, rather than propagating through
** extremely complex negations of CONS types were not being
sufficiently canonicalized, leading to inconsistencies in
SUBTYPEP.
- ** VALUES tranformer lost derive type.
+ ** VALUES tranformer lost derived type.
planned incompatible changes in 0.8.x:
* (not done yet, but planned:) When the profiling interface settles
\f
(fmakunbound 'install-condition-slot-reader)
(fmakunbound 'install-condition-slot-writer)
+
+(defmacro standard-method-function (lambda &environment env)
+ (let ((proto-gf (load-time-value
+ (ensure-generic-function (gensym)))))
+ (multiple-value-bind (lambda initargs)
+ (sb-mop:make-method-lambda
+ proto-gf
+ (sb-mop:class-prototype (sb-mop:generic-function-method-class proto-gf))
+ lambda
+ env)
+ `(values #',lambda ,initargs))))
+
(defun install-condition-slot-reader (name condition slot-name)
- (unless (fboundp name)
- (ensure-generic-function name))
- (eval `(defmethod ,name ((.condition. ,condition))
- (condition-reader-function .condition. ',slot-name))))
+ (let ((gf (if (fboundp name)
+ (ensure-generic-function name)
+ (ensure-generic-function name :lambda-list '(condition)))))
+ (if (and (eq (class-of gf) (find-class 'standard-generic-function))
+ (eq (sb-mop:generic-function-method-class gf)
+ (find-class 'standard-method)))
+ (multiple-value-bind (method-fun initargs)
+ (standard-method-function
+ (lambda (condition)
+ (condition-reader-function condition slot-name)))
+ (add-method gf
+ (apply #'make-instance
+ 'standard-method
+ :specializers (list (find-class condition))
+ :lambda-list '(condition)
+ :function method-fun
+ initargs)))
+ (eval `(defmethod ,name ((condition ,condition))
+ (condition-reader-function condition ',slot-name))))))
+
(defun install-condition-slot-writer (name condition slot-name)
- (unless (fboundp name)
- (ensure-generic-function name))
- (eval `(defmethod ,name (new-value (.condition. ,condition))
- (condition-writer-function .condition. new-value ',slot-name))))
+ (let ((gf (if (fboundp name)
+ (ensure-generic-function name)
+ (ensure-generic-function name :lambda-list '(new-value condition)))))
+ (if (and (eq (class-of gf) (find-class 'standard-generic-function))
+ (eq (sb-mop:generic-function-method-class gf)
+ (find-class 'standard-method)))
+ (multiple-value-bind (method-fun initargs)
+ (standard-method-function
+ (lambda (new-value condition)
+ (condition-writer-function condition new-value slot-name)))
+ (add-method gf
+ (apply #'make-instance
+ 'standard-method
+ :specializers (list (find-class t)
+ (find-class condition))
+ :lambda-list '(new-value condition)
+ :function method-fun
+ initargs)))
+ (eval `(defmethod ,name (new-value (condition ,condition))
+ (condition-writer-function condition new-value ',slot-name))))))