X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;ds=sidebyside;f=src%2Fpcl%2Fstd-class.lisp;h=c1e6af30745220bff339d65a7573575ee1646e72;hb=dd09e391c3c780c948d02ce7bc214a8a9155aef3;hp=9c077f957eb941dc369965068adc945a88a0e24f;hpb=b704b22c4bea05b9e6551ef0c0a26add7a7df083;p=sbcl.git diff --git a/src/pcl/std-class.lisp b/src/pcl/std-class.lisp index 9c077f9..c1e6af3 100644 --- a/src/pcl/std-class.lisp +++ b/src/pcl/std-class.lisp @@ -957,6 +957,32 @@ (eq (class-of o) (class-of n))) (return nil))))))) +(defun style-warn-about-duplicate-slots (class) + (do* ((slots (slot-value class 'slots) (cdr slots)) + (dupes nil)) + ((null slots) + (when dupes + (style-warn + "~@~@:>" + class dupes))) + (let* ((slot-name (slot-definition-name (car slots))) + (oslots (and (not (eq (symbol-package slot-name) + *pcl-package*)) + (remove-if + (lambda (slot-name-2) + (or (eq (symbol-package slot-name-2) + *pcl-package*) + (string/= slot-name slot-name-2))) + (cdr slots) + :key #'slot-definition-name)))) + (when oslots + (pushnew (cons slot-name + (mapcar #'slot-definition-name oslots)) + dupes + :test #'string= :key #'car))))) + (defun %update-slots (class eslotds) (multiple-value-bind (instance-slots class-slots custom-slots) (classify-slotds eslotds) @@ -982,24 +1008,7 @@ (wrapper-slot-table nwrapper) (make-slot-table class eslotds) (wrapper-length nwrapper) nslots (slot-value class 'wrapper) nwrapper) - (do* ((slots (slot-value class 'slots) (cdr slots)) - (dupes nil)) - ((null slots) - (when dupes - (style-warn - "~@~@:>" - class dupes))) - (let* ((slot (car slots)) - (oslots (remove (slot-definition-name slot) (cdr slots) - :test #'string/= - :key #'slot-definition-name))) - (when oslots - (pushnew (cons (slot-definition-name slot) - (mapcar #'slot-definition-name oslots)) - dupes - :test #'string= :key #'car)))) + (style-warn-about-duplicate-slots class) (setf (slot-value class 'finalized-p) t) (unless (eq owrapper nwrapper) (maybe-update-standard-slot-locations class)))))