(if (= (%signum s) (%signum g)) ; or EQL?
(values t t)
(values nil t)))
+
+;; this method is perhaps interesting enough to talk about?
+(defmethod specializer-accepts-generalizer-p ((gf signum-generic-function) (specializer sb-mop:specializer) (thing signum-specializer))
+ (specializer-accepts-generalizer-p gf specializer (class-of (%signum thing))))
+
+
(defmethod specializer-accepts-p ((s signum-specializer) o)
(and (realp o) (= (%signum s) (signum o))))
(defgeneric fact (n)
(:generic-function-class signum-generic-function))
-(defmethod fact ((n (signum 1))) (* n (fact (1- n))))
(defmethod fact ((n (signum 0))) 1)
+(defmethod fact ((n (signum 1))) (* n (fact (1- n))))
(defmethod fact ((n (signum -1)))
(error "factorial of negative number: ~D" n))
#+end_src