【问题标题】:How to Retrieve Method's Signature in Squeak如何在 Squeak 中检索方法的签名
【发布时间】:2010-05-12 07:20:59
【问题描述】:
printThisMethodSig: aSomething
stack := thisContext stackOfSize: 2.
Transcript show: (stack at: 2); cr.

stack at: 2 返回当前方法的方法上下文。可以使用method 消息检索当前方法的编译方法。我希望能够打印该方法的整个签名,例如:from:to:。 我查看了 MethodContext 和 CompiledMethod 类,但不知道该怎么做。

谢谢。

【问题讨论】:

    标签: reflection squeak


    【解决方案1】:

    您可以使用selector 消息来检索CompiledMethod 的名称。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2016-02-23
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2011-10-10
      相关资源
      最近更新 更多