Smalltalk/X WebserverDocumentation of class 'Method::MethodWhoInfo': | ||
Class: MethodWhoInfo (private in MethodThis class is only visible from within Method.Inheritance:Object | +--Method::MethodWhoInfo
Description:In earlier times, Method>>who returned an array filled with the method's class and selector. This was done, since a smalltalk method cannot return multiple values, but 2 values had to be returned from that method. Thus, the who-interface was used as: info := <someMethod> who. class := info at:1. sel := info at:2. Sure, this is ugly coding style, and the system has been changed to return an object (an instance of MethodWhoInfo) which responds to the two messages: #methodClass and #methodSelector. This allows to write things much more intuitive: info := <someMethod> who. class := info methodClass. sel := info methodSelector. However, to be backward compatible, the returned object still responds to the #at: message, but only allows inices of 1 and 2 to be used. The MethodWhoInfo class is private to Method - its not visible to other classes. Related information:Method Class protocol:instance creation
Instance protocol:accessing
|
||
ST/X 7.7.0.0; WebServer 1.702 at 20f6060372b9.unknown:8081; Tue, 10 Dec 2024 09:56:19 GMT |