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

Re: ambiguity in defgeneric and method descriptions

    That makes perfect sense, but I think it brings up another
    point to clarify.    What happens if no method descriptions are
    specified in this defgeneric, but there is an existing generic
    function with methods? Have we decided what happens then?   I don't
    remember any discussion about it.

    In the old days of defgeneric (before method descriptions), we
    said that  no methods were affected when a generic function was
    redefined.    If that still holds in the current scheme, the users
    might be faced with an interesting pitfall.    If the old
    defgeneric included a method description and the new one doesn't,
    then the Lisp world will contain a method, but there won't be any
    source of that method.    

    The alternative would be to follow the model of defclass; if
    the old  defclass defined readers or accessors and the new defclass
    does not, during the redefinition those old methods and generic
    functions go away. We could make old methods that were defined by
    the :method option to defgeneric go away, if the new defgeneric
    doesn't define those methods. 

    Whichever one is right, it's worth another Remark.  

I think that it is important thatold methods stay around.  Consider two
applications that define a generic function.  They are designed to work
independently, and also together.  Hence each will have a defgeneric
(compatible of course, since they were meant to work together), and each
will independently define methods, say with their :method options.  The
fact the the second one does not have the same methods as the first
should not invalidate the first, I think.  The model I have is that
defgeneric updates the generic function with respect to its metaclass,
method class, etc. but does not affect existing methods.  An error is
signalled for any compatibility problem of course.  This is the same as
the old model.  As you can see in some cases there are sources for the
other methods, and in others not (what happens now when you simply edit
a file to remove a defmethod or defun form?)