Christophe Weblog Wiki Code Publications Music
package fixup for cons specializers
authorChristophe Rhodes <csr21@cantab.net>
Wed, 11 Dec 2013 20:49:56 +0000 (20:49 +0000)
committerChristophe Rhodes <csr21@cantab.net>
Wed, 11 Dec 2013 20:49:56 +0000 (20:49 +0000)
also note a problem with the current protocol

cons-specializer.lisp

index 70529d4ae4d4709df38d020a6b17183588d9787e..0c834f20958bd1f8af5899bb924b0d7c6b79dfd7 100644 (file)
@@ -1,3 +1,5 @@
+(in-package "SPECIALIZABLE")
+
 ;;;; CONS-SPECIALIZER example
 (defclass cons-specializer (extended-specializer)
   ((car :initarg :car :reader %car)))
@@ -35,7 +37,8 @@
        (eql (car obj) (%car specializer))))
 ;;; but this one does: it doesn't look like it here, but at issue is
 ;;; who is responsible for the SPECIALIZER< method for two distinct
-;;; user-defined specializers.
+;;; user-defined specializers.  Also consider a symbol generalizer
+;;; being used to compare two class specializers.
 (defmethod specializer< ((s1 cons-specializer) (s2 cons-specializer) generalizer)
   (declare (ignore generalizer))
   (if (eql (%car s1) (%car s2))