question about method dispatch

Stephen Pair spair at advantive.com
Fri May 10 18:46:05 UTC 2002


If I understand your question correctly, you cannot change the method
dispatch algorithm in Squeak without modifying the VM.  However, you can
simulate a custom dispatch algorithm using the #doesNotUnderstand:
method.  That method gives you an instantiated message object and you
are free to interpret the message any way you like.  The downside is
that it's slower, and any actual methods implemented on your object will
mask the #doesNotUnderstand: method (#doesNotUnderstand: is sent
whenever the VM cannot find a method in the method dictionary (or a
superclass' method dictionary) that matches the selector).  The argument
is a reified version of the message that was sent, but not understood
(hence the name).  Have a look at Interpreter>>internalFindNewMethod
(and related methods) to see where the VM implements the dispatch
algorithm.
 
- Stephen

-----Original Message-----
From: squeak-dev-admin at lists.squeakfoundation.org
[mailto:squeak-dev-admin at lists.squeakfoundation.org] On Behalf Of Jessie
Dedecker
Sent: Friday, May 10, 2002 2:36 PM
To: squeak-dev at lists.squeakfoundation.org
Subject: question about method dispatch


Hello,
 
could anyone please tell me how I can change the method dispatch in
smalltalk.  I tried to change the ContextPart>>send:super:numArgs: but I
guess
this doesn't work because of optimisations that were performed.
 
Is there a way to change the dispatch?
 
Thanks,
 
Jessie Dedecker

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20020510/0e3ecbd8/attachment.htm


More information about the Squeak-dev mailing list