Smalltalk reflection - how to get the method name?

Suppose I have a class and an instance method:

 ClassExample#methodExample
      ^"???"

Is there a way in Smalltalk to get the method name:

 var := ClassExample new.
 nameOfMyMethod := var methodExample.
 "nameOfMyMethod should be 'methodExample' (a string or symbol)"

?

I am developing in VisualAge. Thanks for the help!

+4
source share
1 answer

Try the following:

methodExample
    ^(Processor activeProcess stackAtFrame: 0 offset: -9) selector
+4
source

All Articles