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

EQL specializers

Is there any good reason that the following,

(in-package :pcl)

(defmethod divide ((dividend number) (divisor number))
  (/ dividend divisor))

(defmethod divide ((dividend number) (zero (eql 0)))
  (error "Cannot divide by zero."))

which was taken from Keene, p. 94, should not work in PCL?
Actually, I get an error message at load time, to the following

Error: No matching method for the generic-function #<Function
CLASS-NAME @ #x4b36e9>, when called with arguments ((EQL 0))

but then after I abort out of the debugger, instances will reflect the
new definition, i.e., (divide 12 0) will be handled specially.

I am using:

PCL system date: 5/22/89  Victoria Day PCL
Lisp Implementation type: Allegro CL
Lisp Implementation version: 3.1.13 [Sun3] (4/24/90)

I am told that we cannot upgrade to the newer May Day PCL because of
Franz incompatibilities.  If the fix to this is only available in May
Day, then I guess I will just patch CLASS-NAME locally and live with