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

CLOS



>CMU Common Lisp 16b, running on stetten
>Hemlock 3.5 (16b), Python 1.0(16b), target SPARCstation/Sun 4
>Send bug reports and questions to cmucl-bugs@cs.cmu.edu.

Why doesn't the following work?

;;;; File test3.lisp

(defmethod fact ((x (eql 0)))
  1)

(defmethod fact ((x INTEGER))
  (* x (fact (1- x))))

[the order of defmethods doesn't change the error message]


>Error in function "DEFMETHOD NO-APPLICABLE-METHOD".
>No matching method for the generic-function #<Standard-Generic-Function PCL::SAME-SPECIALIZER-P (2) {5369EC1}>,
>when called with arguments (#<PCL::EQL-SPECIALIZER {713622D}>
>                            #<Built-In-Class INTEGER {53AF9E5}>).
>
>Restarts:
>  0: [CONTINUE] Retry call to #<Standard-Generic-Function PCL::SAME-SPECIALIZER-P (2) {5369EC1}>
>  1:            Return NIL from load of "test3.lisp".
>  2: [ABORT   ] Return to Top-Level.


Is it forbidden to instanciate on predefined classes? (fact 0 works)
Any help would be appreciated.

	Joerg.