Christophe Weblog Wiki Code Publications Music
flush the EMF cache in REINITIALIZE-INSTANCE of SPECIALIZABLE-GENERIC-FUNCTION
authorChristophe Rhodes <csr21@cantab.net>
Thu, 12 Dec 2013 14:54:06 +0000 (14:54 +0000)
committerChristophe Rhodes <csr21@cantab.net>
Thu, 12 Dec 2013 14:54:06 +0000 (14:54 +0000)
specializable.lisp

index 29ad9260ff1f2d78abc78879e0e50902013081dc..979f51476cb01d41b4709c77409b458955bdd0df 100644 (file)
 ;;; FIXME: in some kind of order, the discriminating function needs to handle:
 ;;; - argument count checking;
 ;;; - keyword argument validity;
-;;; - flushing the emf cache on method addition/removal
+;;; - DONE flushing the emf cache on method addition/removal
 ;;; - flushing the cache on class redefinition;
 ;;; - cache thread-safety.
 (defmethod sb-mop:compute-discriminating-function ((gf specializable-generic-function))
          (sb-pcl::invoke-emf emfun args)
          (slow-method-lookup gf args generalizers)))))
 
+(defmethod reinitialize-instance :after ((gf specializable-generic-function) &key)
+  (clrhash (emf-table gf)))
+
 (defun slow-method-lookup (gf args generalizers)
   ;; differs from closette
   (multiple-value-bind (applicable-methods definitivep)