Blocks (Re: Fear and loathing of the "perification" of Smalltalk)

tim Rowledge tim at rowledge.org
Mon Sep 17 17:14:43 UTC 2007


On 17-Sep-07, at 2:35 AM, Colin Putney wrote:

>
> I see what Alan was getting at about violating encapsulation: if  
> you create a block that can access an object's internal state, then  
> use it as a method of some *other* object, you end up with two  
> objects that are quite intertwined, a sort of quantum entanglement  
> between objects.
Actually I'd like to suggest another way of looking at that; you can  
only get the 'encapsulation violation' by compiling the block  
originally within the class you are violating. Passing a block out to  
some other object is really nothing more than handing out permission;  
it's making the other object into a "friend with privileges".

tim
--
tim Rowledge; tim at rowledge.org; http://www.rowledge.org/tim
Fractured Idiom:- ALOHA OY - Love; greetings; farewell; from such a  
pain you should never know





More information about the Squeak-dev mailing list