[Vm-dev] Method executing but not sent to the receiver

Mariano Martinez Peck marianopeck at gmail.com
Wed Apr 20 12:29:29 UTC 2011


On Wed, Mar 30, 2011 at 8:55 PM, Levente Uzonyi <leves at elte.hu> wrote:

>
> On Wed, 30 Mar 2011, Mariano Martinez Peck wrote:
>
> (no quotes)
>

It's pure smalltalk code. 'foobar' is a ByteString and it will execute a
> method of ByteArray. The method is called #atAllPut: and it will be
> evaluated with the argument 65.
>
>
Sorry for the late answer. I think you didn't understand what I asked or I
didn't understand your answer.

In that example, you are SENDING the message withArgs:executeMethod:   to
the receiver.

What I need is this...imagine I have Message instance, and I need to do a
#sendTo:   but WITHOUT using the receiver but instead sending it by
parameter.
I cannot do:  aMessage sendTo: aReceiver
because

sendTo: receiver
    "answer the result of sending this message to receiver"

    ^ receiver perform: selector withArguments: args


So...as you can see, #sendTo sends a message to the receiver, which I
cannot.
Instead of delegating to the receiver, I need someting like this:


CompiledMethod >> valueWithReceiver: aReceiver arguments: anArray
    "Execute compiledMethod against the receiver and args in argArray. The
receiver is the CompiledMethod"

    <primitive: 666>
    self primitiveFailed


Where the primitive is send directly, and not a message to the receiver.

Is something like this available or I would need to create a new primitive?

Thanks in advance,

-- 
Mariano
http://marianopeck.wordpress.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.squeakfoundation.org/pipermail/vm-dev/attachments/20110420/741b66c8/attachment.htm


More information about the Vm-dev mailing list