如何在 Squeak 中检索方法的签名
printThisMethodSig: aSomething
stack := thisContext stackOfSize: 2.
Transcript show: (stack at: 2); cr.
stack at: 2
返回当前方法的方法上下文。可以使用 method
消息检索当前方法的编译方法。我希望能够打印该方法的整个签名,例如:from:to:
。 我查看了 MethodContext 和 CompiledMethod 类,但不知道如何做到这一点。
谢谢。
printThisMethodSig: aSomething
stack := thisContext stackOfSize: 2.
Transcript show: (stack at: 2); cr.
stack at: 2
returns the method context of the current method. It is possible to retrieve the compiled method of the current method using method
message. I want to be able to print the whole signature of the method, for example: from:to:
.
I looked at both MethodContext and CompiledMethod classes but could not find out how to do it.
Thank you.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以使用
selector
消息来检索CompiledMethod
的名称。You can use the
selector
message to retrieve the name of aCompiledMethod
.