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

add-method when method exists



In the current version of the spec, if add-method is used to add a
method to a generic function and there is already a method with the same
specializers and qualifiers and error is signaled.  I think thats a bad
idea, I think it should just remove the old method and add the new one.
Note that it should NOT call remove-method to remove the old one.

The reason is that very often you want to replace an existing method
with a new method.  Take the following example:

(defmethod foo :before ((x object)) 'before)

(defmethod foo ((x object)) 'primary)

If I want to redefine the second method, I want to replace it with the
new method, I don't want to first remove the old method because if I do,
the generic function will be in an illegal state (it will have no
primary method).
-------