eXept Software AG Logo

Smalltalk/X Webserver

Documentation of class 'Method::MethodWhoInfo':

Home

Documentation
www.exept.de
Everywhere
for:
[back]

Class: MethodWhoInfo (private in Method

This class is only visible from within Method.

Inheritance:

   Object
   |
   +--Method::MethodWhoInfo

Package:
stx:libbasic
Category:
Kernel-Methods
Owner:
Method
Author:
Claus Gittinger

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
o  class: cls selector: sel
return a new MethodWhoInfo object;
this is a private interface for Method


Instance protocol:

accessing
o  method

o  methodClass
return the class which contains the method represented by myself

Usage example(s):

     (Method compiledMethodAt:#who) who methodClass
     (Method::MethodWhoInfo compiledMethodAt:#methodClass) who methodClass

o  methodSelector
return the selector under which the the method represented by myself
is found in the class

comparing
o  = something
(comment from inherited method)
return true if the receiver and the arg have the same structure.
Notice:
This method is partially open coded (inlined) by the compiler(s)
identical objects are always considered equal.
redefining it may not work as expected.

compatibility
o  at: index
simulate the old behavior (when Method>>who returned an array)

private-accessing
o  class: cls selector: sel



ST/X 7.7.0.0; WebServer 1.702 at 20f6060372b9.unknown:8081; Sat, 27 Jul 2024 03:56:49 GMT