[Vm-dev] Simulator Question

Eliot Miranda eliot.miranda at gmail.com
Thu Jan 6 17:23:05 UTC 2011


Hi Gabriel,

On Thu, Jan 6, 2011 at 7:41 AM, Gabriel Hernán Barbuto
<gbarbuto at gmail.com>wrote:

>
> Hi
>
> I am working with the InterpreterSimulator and I would like to send a
> message to an object inside the simulated environment. For example, I
> have the oop for true and I want to send it the message printString.
>
> My question is if this is possible. I don't know if there is a way to
> send a message to an object inside the simulation. I have thought
> about tinkering with the stack and calling an interpreter method. But
> I am not sure if this will work.
>

I'm sure you could get it to work. To send printString to true simply push
true, set messageSelector to printString (there are methods to search for
strings to track down the selector) and argumentCount to 0 and send
commonSend.  There are all sorts of issues.  Is the VM at a suspension
point?  Will the stack be balanced?  What if a process switch happens during
your message?  How can you collect the result?  But these al have answers.

What are you actually trying to do?


> Any hint will be much appreciated. Thanks in advance.
>
> Gabriel
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.squeakfoundation.org/pipermail/vm-dev/attachments/20110106/a2be1f19/attachment-0001.htm


More information about the Vm-dev mailing list