[squeak-dev] Re: The Trunk: Kernel-dtl.331.mcz
Eliot Miranda
eliot.miranda at gmail.com
Wed Dec 23 18:12:04 UTC 2009
On Sat, Dec 19, 2009 at 4:12 AM, Andreas Raab <andreas.raab at gmx.de> wrote:
> Eliot Miranda wrote:
>
>> Interesting! To my mind that definition is incorrect. I would expect
>> the sender of a block to be the sender of the enclosing method, in which
>> case the definition would arguably be
>>
>> BlockClosure methods for accessing
>> sender
>> ^self home sender
>>
>> A block activation's caller would be it's sender slot, so within a block
>> you might refer to thisContext caller. But what is arguably a bug in my
>> implementation is that within a block activation thisContext sender refers
>> to the caller (the sender of value: to the activation's block) not to the
>> sender of the enclosing method.
>>
>
> How about instead of faking out BlockClosure>>sender we fix MessageTally
> along the lines of:
>
> MessageTally>>tallySendsTo:inBlock:showTree:
>
> prev := aBlock asContextWithSender: thisContext.
>
> This should work just as well if I understand the intent of the change
> correctly.
>
That's right. In the Teleplace codebase we simply use asContext:
tallySendsTo: receiver inBlock: aBlock showTree: treeOption
...
thisContext sender
runSimulated: (prev := aBlock asContext)
contextAtEachStep:
[:current |
...
>
> Cheers,
> - Andreas
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20091223/318e5f35/attachment.htm
More information about the Squeak-dev
mailing list
|