question about method dispatch

Jessie Dedecker jededeck at vub.ac.be
Fri May 10 19:01:56 UTC 2002


MessageHello again,

thanks for replying so soon :)

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.
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?

Thanks,

Jessie Dedecker
  ----- Original Message ----- 
  From: Stephen Pair 
  To: squeak-dev at lists.squeakfoundation.org 
  Sent: Friday, May 10, 2002 3:46 PM
  Subject: RE: question about method dispatch


  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/dea78efe/attachment.htm


More information about the Squeak-dev mailing list