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

One more Genera bugfix.



	This patch fixes the bug where traced generic functions cause an
error if you try adding or redefining methods on that gfn (this bug was
discussed a little last (?) week, and has been annoying me for the
longest time....)

	-mike (mthome@bbn.com)

 = = = = = =
;;; PATCH BOOT.LISP
;;;   Fixed problem where traced generic functions are not redefinable (the original
;;; of the below function took the encapsulation as the gfn itself).
;;;  MT - 880926
;;;
(defun ensure-generic-function (spec &rest keys
				     &key lambda-list
					  argument-precedence-order
					  declarations
					  documentation
					  method-combination
					  generic-function-class
					  method-class)
  (declare (ignore lambda-list argument-precedence-order declarations
		   documentation method-combination method-class))
  (let ((existing (and (gboundp spec)
		       (gdefinition spec))))
    (cond ((null existing)
	   (let ((new (apply #'ensure-gf-internal spec keys)))
	     (setq new (set-function-name new spec))
	     (setf (gdefinition spec) new)))
	  ((funcallable-instance-p existing) existing)	  
	  #+genera				; MT
	  ((si:function-encapsulated-p spec)
	   (apply #'ensure-generic-function (si:unencapsulate-function-spec spec) keys))
	  (existing
	   #+Lispm
	   (zl:signal 'generic-clobbers-function :name spec)
	   #-Lispm
	   (error "~S already names an ordinary function or a macro,~%~
                   it can't be converted to a generic function."
		  spec)))))