Reputation: 283
Assume I have a class and an instance method:
ClassExample#methodExample
^"???"
Is there any way in Smalltalk to get the name of the method:
var := ClassExample new.
nameOfMyMethod := var methodExample.
"nameOfMyMethod should be 'methodExample' (a string or symbol)"
?
I'm developing in VisualAge. Thanks for help!
Upvotes: 5
Views: 409
Reputation: 2847
Try this:
methodExample
^(Processor activeProcess stackAtFrame: 0 offset: -9) selector
Upvotes: 5