On Sat, Dec 19, 2009 at 01:12:25PM +0100, Andreas Raab 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.
FYI, Nicolas Cellier is the original author, I just copied his implementation into Squeak because I noticed the broken MessageTally.
Dave