<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=us-ascii">
<TITLE>Message</TITLE>
<META content="MSHTML 6.00.2712.300" name=GENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=#ffffff>
<DIV><SPAN class=997513718-10052002><FONT face=Arial color=#0000ff size=2>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.</FONT></SPAN></DIV>
<DIV><SPAN class=997513718-10052002><FONT face=Arial color=#0000ff
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=997513718-10052002><FONT face=Arial color=#0000ff size=2>-
Stephen</FONT></SPAN></DIV>
<BLOCKQUOTE dir=ltr
style="PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #0000ff 2px solid; MARGIN-RIGHT: 0px">
<DIV></DIV>
<DIV class=OutlookMessageHeader lang=en-us dir=ltr align=left><FONT
face=Tahoma size=2>-----Original Message-----<BR><B>From:</B>
squeak-dev-admin@lists.squeakfoundation.org
[mailto:squeak-dev-admin@lists.squeakfoundation.org] <B>On Behalf Of
</B>Jessie Dedecker<BR><B>Sent:</B> Friday, May 10, 2002 2:36 PM<BR><B>To:</B>
squeak-dev@lists.squeakfoundation.org<BR><B>Subject:</B> question about method
dispatch<BR><BR></FONT></DIV>
<DIV><FONT face=Arial size=2>Hello,</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>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</FONT></DIV>
<DIV><FONT face=Arial size=2>this doesn't work because of optimisations that
were performed.</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>Is there a way to change the
dispatch?</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>Thanks,</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>Jessie
Dedecker</FONT></DIV></BLOCKQUOTE></BODY></HTML>