[英]How to print a string that is sent as a parameter to class method in smalltalk
[英]smalltalk reflection - how to get method name?
假设我有一个类和一个实例方法:
ClassExample#methodExample
^"???"
Smalltalk中有什么方法可以获取方法的名称:
var := ClassExample new.
nameOfMyMethod := var methodExample.
"nameOfMyMethod should be 'methodExample' (a string or symbol)"
?
我正在VisualAge中进行开发。 感谢帮助!
尝试这个:
methodExample
^(Processor activeProcess stackAtFrame: 0 offset: -9) selector
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.