Newsgroups: comp.lang.smalltalk
Path: cantaloupe.srv.cs.cmu.edu!bb3.andrew.cmu.edu!newsfeed.pitt.edu!scramble.lm.com!news.math.psu.edu!news.cse.psu.edu!uwm.edu!news-res.gsl.net!news.gsl.net!usenet.eel.ufl.edu!tank.news.pipex.net!pipex!dish.news.pipex.net!pipex!mk2!
From: dpeachey@vmark.co.uk (Dan Peachey)
Subject: Re: Enfin internals
Organization: VMark Software Ltd.
Date: Mon, 8 Jul 96 08:31:35 GMT
Message-ID: <1996Jul8.083135.9070@vmark.co.uk>
X-Newsreader: Forte Free Agent 1.0.82
References: <31DDD4C7.315@orbonline.net>
Sender: @vmark.co.uk
Lines: 41

Florin Mateoc <mateoc@orbonline.net> wrote:

>I am trying to use #setSendHookTo: in order to trap some messages and replace 
>them on the fly with some other ones.
>I was able to trap the message, to send the new one, but I could not get rid 
>of the old one that was waiting on the method stack, so both methods get 
>executed. I was thinking of using #getProgramCounterStack and 
>#programCounterStackAt:, but they are both primitives, undocumented and "not 
>for application developer's use".

>Has anybody done something similar in Enfin?

>Thank you,

>Florin Mateoc
>Mark Winter & Associates - Toronto

Hi,

I don't think that this is possible.  When you send a message in ENFIN
it pushes the reciever and args for that message onto the Lanaguage
Parameter stack,  but not the message itself.  Hence you could write
an ENFIN primitive that manipulates the stack (pops off args and then
pops on different values),  but since the message is not there it is
not possible to replace it and it will always be executed.

However,  how's this for an idea:

write a Primitive that replaces the reciever of the message you want
to get rid off.  The reciever could be changed to something like
TrashObject which is an instance of a special Object where all methods
simply return self.

Not very efficient,  and it may not even work,  but its just an idea.

Cheers

Dan

ObjectStudio Support UK.

