"Alan" == Alan Kay alan.kay@vpri.org writes:
Alan> Sure. I simply meant that a block containing an assignment to the Alan> internal state of an object can be passed around willy nilly to other Alan> objects and some random time in the future can be sent value and presto! Alan> you've cause a side effect on the internal state of the object that will Alan> be very hard to track down if it's a bug.
But that's no different from some other object holding a reference to your object, then invoking a named method at a random time.
Putting dangerous things into a named method is no better or worse than putting dangerous things into a closure/block. You are still in control about the damage that can be caused "from the outside".
In fact, I'd go so far as to argue that a closure is nothing more than an unnamed method, and should be treated with the same care and feeding as named methods.