Christophe Weblog Wiki Code Publications Music
call NO-APPLICABLE-METHOD in the appropriate place
[specializable.git] / signum-specializer.lisp
index a5d21fa2d5ca1b2c026813a3f60384d34dbe42bb..ab7c0de346b2470adf65d7fee5c03b4ef93470f1 100644 (file)
    (defmethod fact ((n (signum 0))) 1)
    (defmethod fact ((n (signum 1))) (* n (fact (1- n))))
    (assert (eql (fact 6) 720))
-   (assert (eql (fact 6.0) 720.0))))
+   (assert (eql (fact 6.0) 720.0))
+   (defmethod no-applicable-method ((gf (eql #'fact)) &rest args)
+     'gotcha)
+   (assert (eql (fact -6) 'gotcha))))
 
 (eval
  '(progn