<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD><TITLE>Message</TITLE>
<META http-equiv=Content-Type content="text/html; charset=iso-8859-1">
<META content="MSHTML 6.00.2600.0" name=GENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=#ffffff>
<DIV><FONT face=Arial size=2>Hello again,</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>thanks for replying so soon :)</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>I already took the optional of the
#doesNotUnderstand: method into account, however I would like to change the
dispatch for <all> objects and <all> messages, also existing
ones.</FONT></DIV>
<DIV><FONT face=Arial size=2>But if I understood you correctly there is no way
to change the dispatch using the reflective capabilities of Smalltalk? So
I should start looking at the C-code instead or did I understood it
incorrectly?</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 dir=ltr
style="PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
<DIV style="FONT: 10pt arial">----- Original Message ----- </DIV>
<DIV
style="BACKGROUND: #e4e4e4; FONT: 10pt arial; font-color: black"><B>From:</B>
<A title=spair@advantive.com href="mailto:spair@advantive.com">Stephen
Pair</A> </DIV>
<DIV style="FONT: 10pt arial"><B>To:</B> <A
title=squeak-dev@lists.squeakfoundation.org
href="mailto:squeak-dev@lists.squeakfoundation.org">squeak-dev@lists.squeakfoundation.org</A>
</DIV>
<DIV style="FONT: 10pt arial"><B>Sent:</B> Friday, May 10, 2002 3:46 PM</DIV>
<DIV style="FONT: 10pt arial"><B>Subject:</B> RE: question about method
dispatch</DIV>
<DIV><BR></DIV>
<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></BLOCKQUOTE></BODY></HTML>