eXept Software AG Logo

Smalltalk/X Webserver

Documentation of class 'Method::MethodWhoInfo':

Home

everywhere
www.exept.de
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 methods 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

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

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

private-accessing
o  class: cls selector: sel



ST/X 6.1.1; WebServer 1.620 at exept:8081; Tue, 22 May 2012 21:15:38 GMT