我如何取消实习生的合格方法? [英] How can I unintern a qualified method?

查看:217
本文介绍了我如何取消实习生的合格方法?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在开发过程中,我定义了一个'initialize-instance:after'方法,该方法在一段时间后不再需要,并且实际上妨碍了我,因为它在其中调用了不再有效的代码.由于unintern函数没有用于限定符的参数,因此我有什么方法可以"unintern"方法的符号-限定符组合,从而不必粘液重新启动下级lisp并加载从头开始重新设计项目?

During development I defined an 'initialize-instance :after' method which after a while was not needed anymore and actually gets in my way because inside it calls code that is not valid anymore. Since the unintern function does not have an argument for the qualifier, is there any way I can "unintern" the symbol-qualifier combination of a method so that I don't have to slime-restart-inferior-lisp and load the project again from the start?

推荐答案

您可以使用标准函数find-methodremove-method来做到这一点:

You can use the standard functions find-method and remove-method to do it:

(remove-method (find-method #'frob '(:before) '(vehicle t)))

我发现使用史莱姆检查器要容易得多.如果您的函数名为frob,则可以使用M-x slime-inspect #'frob RET查看frob上所有方法的列表,并选择要删除的单个方法.

I find it's much easier to use the slime inspector. If your function is named frob, you can use M-x slime-inspect #'frob RET to see a list of all methods on frob and select individual methods for removal.

这篇关于我如何取消实习生的合格方法?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆