eXept Software AG Logo

Smalltalk/X Webserver

Documentation of class 'PrototypeLookupAlgorithm':

Home

everywhere
www.exept.de
for:
[back]

Class: PrototypeLookupAlgorithm


Inheritance:

   Object
   |
   +--PrototypeLookupAlgorithm

Package:
stx:libbasic
Category:
Kernel-Classes
Version:
rev: ? date: ? ?
user: ?
file: ? directory: libbasic
module: stx stc-classLibrary: libbasic
Author:
cg (cg@CG-PC)

Description:


this is a dummy lookupAlgorithm class to demonstrate the meta-object-protoocol support.
Create a sumclass of me, redefine the lookupmethod to return a method proper.
If it returns nil, a doesNotUnderstand will be sent, as usual.

This class does nothing real - it duplicates the algorithm as found in the VM.


Related information:

    jan
    Vrany's
    paper
    on
    Smalltalk's
    Meta-Object-Protocol
    proposal.

Class protocol:

instance creation
o  new


Instance protocol:

lookup
o  lookupMethodForSelector: aSelector directedTo: searchClass for: aReceiver withArguments: argArrayOrNil from: sendingContext
invoked by the VM to ask me for a method to call.
The arguments are: the selector, receiver and arguments,
the class to start the search in (for here-, super and directed sends)
the sending context.

The returned method object will be put into the inline- and polyCache
at the call site; it might therefore be called more than once for the
same receiver-class/selector combination (once for each call site).
If I return nil, a doesNotUnderstand will be invoked.


Examples:


this is only a test for the lookup; when installed as a class's lookupObject, the lookup will be called from the VM for instances of that class. |mthd| mthd := self new lookupMethodForSelector:#squared directedTo:nil for:100 withArguments:nil from:nil. mthd valueWithReceiver:100 arguments:#().

ST/X 6.1.1; WebServer 1.620 at exept:8081; Wed, 23 May 2012 20:45:31 GMT