[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

qualifier are non-nil-atoms bug

Here are to simple patches.  The clos spec says qualifiers are non-nil-atoms
but PCL used SYMBOLP rather than ATOM.

;;; Patch 3600-low.lisp

(si:define-function-spec-handler method (op spec &optional arg1 arg2)
  (if (eq op 'sys:validate-function-spec)
      (and (let ((gspec (cadr spec)))
	     (or (symbolp gspec)
		 (and (listp gspec)
		      (eq (car gspec) 'setf)
		      (symbolp (cadr gspec))
		      (null (cddr gspec)))))
	   (let ((tail (cddr spec)))
	     (loop (cond ((null tail) (return nil))
			 ((listp (car tail)) (return t))
			 ((atom (pop tail)))			 
			 (t (return nil))))))
      (let ((meth (and (listp spec)
		       (and (fboundp 'generic-function-p)
			    (generic-function-p #'add-method))
		       (multiple-value-bind (ignore method)
			   (parse-method-or-spec (cdr spec) nil)
	(method-definition-handler-1 op spec meth arg1 arg2))))

;;; patch BOOT.LISP

(defun parse-defmethod (cdr-of-form)
  (declare (values name qualifiers specialized-lambda-list body))
  (let ((name (pop cdr-of-form))
	(qualifiers ())
	(spec-ll ()))
    (loop (if (and (car cdr-of-form) (atom (car cdr-of-form)))
	      (push (pop cdr-of-form) qualifiers)
	      (return (setq qualifiers (nreverse qualifiers)))))
    (setq spec-ll (pop cdr-of-form))
    (values name qualifiers spec-ll cdr-of-form)))