smalltalk反射 - 如何获取方法名称?

use*_*568 5 oop reflection smalltalk visual-age

假设我有一个类和一个实例方法:

 ClassExample#methodExample
      ^"???"
Run Code Online (Sandbox Code Playgroud)

有没有办法在Smalltalk中获取方法的名称:

 var := ClassExample new.
 nameOfMyMethod := var methodExample.
 "nameOfMyMethod should be 'methodExample' (a string or symbol)"
Run Code Online (Sandbox Code Playgroud)

我正在开发VisualAge.感谢帮助!

Dav*_*uck 5

试试这个:

methodExample
    ^(Processor activeProcess stackAtFrame: 0 offset: -9) selector
Run Code Online (Sandbox Code Playgroud)