Changeset 15513 for trunk/abcl/src/org/armedbear/lisp/clos.lisp
- Timestamp:
- 08/14/21 06:21:39 (2 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/abcl/src/org/armedbear/lisp/clos.lisp
r15459 r15513 2179 2179 (declaim (ftype (function * method) ensure-method)) 2180 2180 (defun ensure-method (name &rest all-keys) 2181 (let ((method-lambda-list (getf all-keys :lambda-list)) 2182 (gf (find-generic-function name nil))) 2181 (let* ((method-lambda-list (getf all-keys :lambda-list)) 2182 (gf (find-generic-function name nil)) 2183 (gf-lambda-list (copy-tree method-lambda-list))) 2183 2184 (when (or (eq gf *gf-initialize-instance*) 2184 2185 (eq gf *gf-allocate-instance*) … … 2190 2191 (clrhash *make-instance-initargs-cache*) 2191 2192 (clrhash *reinitialize-instance-initargs-cache*)) 2193 2194 (let ((plist (analyze-lambda-list method-lambda-list))) 2195 (when (getf plist :keywords) 2196 ;; remove all keywords arguments for the generic function definition 2197 (setf gf-lambda-list 2198 (append (subseq gf-lambda-list 0 (position '&key gf-lambda-list)) 2199 '(&key) (if (getf plist :auxiliary-args) 2200 (subseq gf-lambda-list (position '&aux gf-lambda-list))))))) 2192 2201 (if gf 2193 2202 (restart-case … … 2196 2205 (unbind-and-try-again () :report (lambda(s) (format s "Undefine generic function #'~a and continue" name)) 2197 2206 (fmakunbound name) 2198 (setf gf (ensure-generic-function name :lambda-list method-lambda-list))))2199 (setf gf (ensure-generic-function name :lambda-list method-lambda-list)))2207 (setf gf (ensure-generic-function name :lambda-list gf-lambda-list)))) 2208 (setf gf (ensure-generic-function name :lambda-list gf-lambda-list))) 2200 2209 (let ((method 2201 2210 (if (eq (generic-function-method-class gf) +the-standard-method-class+) … … 2348 2357 '(&rest &optional &key 2349 2358 &allow-other-keys)))) 2350 (no-aux (null (some 2351 (lambda (method) 2359 (no-aux (null (some 2360 (lambda (method) 2352 2361 (find '&aux (std-slot-value method 'sys::lambda-list))) 2353 2362 methods)))) … … 2484 2493 (let ((specializer (car specializers))) 2485 2494 (if (typep specializer 'eql-specializer) 2486 (if (eql (class-of (eql-specializer-object specializer)) 2495 (if (eql (class-of (eql-specializer-object specializer)) 2487 2496 (car classes)) 2488 2497 (setf knownp nil) … … 2751 2760 (walk-form (%cdr form))))) 2752 2761 2753 (defmacro flet-call-next-method (args next-emfun &body body) 2762 (defmacro flet-call-next-method (args next-emfun &body body) 2754 2763 `(flet ((call-next-method (&rest cnm-args) 2755 2764 (if (null ,next-emfun) … … 2789 2798 ,(%cadr lambda-list))) 2790 2799 ,@declarations 2791 (flet-call-next-method args next-emfun 2800 (flet-call-next-method args next-emfun 2792 2801 ,@body)))) 2793 2802 (3 … … 2800 2809 ,(%caddr lambda-list))) 2801 2810 ,@declarations 2802 (flet-call-next-method args next-emfun 2811 (flet-call-next-method args next-emfun 2803 2812 ,@body)))) 2804 2813 (t … … 2806 2815 (apply #'(lambda ,lambda-list 2807 2816 ,@declarations 2808 (flet-call-next-method args next-emfun 2817 (flet-call-next-method args next-emfun 2809 2818 ,@body)) 2810 2819 args)))) … … 2848 2857 ,@body)) 2849 2858 nil)))))) 2850 2859 2851 2860 2852 2861 (declaim (notinline make-method-lambda)) … … 3039 3048 when (eq (car method-form) :method) 3040 3049 collect 3041 (multiple-value-bind (function-name qualifiers lambda-list specializers documentation declarations body) 3050 (multiple-value-bind (function-name qualifiers lambda-list specializers documentation declarations body) 3042 3051 (mop::parse-defmethod `(,function-name ,@(rest method-form))) 3043 3052 `(sys::record-source-information-for-type ',function-name '(:method ,function-name ,qualifiers ,specializers)))) … … 3183 3192 3184 3193 (defmethod ensure-class-using-class :before (class name &key direct-slots 3185 direct-default-initargs 3194 direct-default-initargs 3186 3195 &allow-other-keys) 3187 3196 (check-duplicate-slots direct-slots) … … 3323 3332 3324 3333 ;;; Slot access 3325 ;;; 3334 ;;; 3326 3335 ;;; See AMOP pg. 156ff. for an overview. 3327 ;;; 3336 ;;; 3328 3337 ;;; AMOP specifies these generic functions to dispatch on slot objects 3329 3338 ;;; (with the exception of slot-exists-p-using-class), although its … … 4586 4595 4587 4596 (provide "CLOS") 4588
Note: See TracChangeset
for help on using the changeset viewer.