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

Re: Getting rid of methods



Has someone written a function that "undoes" the effect of a definition?

I can think of an implementation that parses a selected definition and
tries to do the right thing, but I've got real work to do.  The following
transcript explains why I want it.

>>>> I prefer to see all initialize-instance methods defined as :after methods, 
>>>> rather than using call-next-method.
>>>
>>> I subconciously stoppped using :before and :after (and :around) methods,
>>> because I have gotten into the situation where I restructured the code,
>>> didn't need them anymore, but CAN'T GET RID OF THEM!
>>>
>> >You can remove-method by hand.
>> >However, you shouldn't have to.  In a decent development environment you would 
>> >just edit the buffer and say "make the running world the same as this" and it 
>> >would notice you had edited out a method and remove it.
>> 
>> Is the something simpler than:
>> (let ((gf (symbol-function 'print-remote-object)))
>>       (remove-method gf (find-method 
>>                              gf 
>>                              '(:around) 
>>                              (list (find-class 'runtime-model) 
>>                                    (find-class 'remote-object)
>>                                    (find-class t))))       
>
>Except for changing (symbol-function 'print-remote-object) to
>#'print-remote-object I don't know anything simpler.  Often though I don't call 
>find-method, but just call generic-function-methods in the listener and then pick 
>out the one I want with first or second or the inspector.
>
>Horrible, isn't it?
----------------------------------------
Derek White      	      (-ex Mr. Pascal)
ATG/East        	       (AppleLink: DEREK)