Why #DoIt? (was: RE: Aha! How to get rid of Blocks in Smalltalk.)

Henrik Gedenryd Henrik.Gedenryd at lucs.lu.se
Sat Apr 22 16:37:19 UTC 2000


Stephen Pair wrote:

> I would like more flexibility in setting up the context in which a sequence
> of instructions is executed.  I would like to be able to evaluate workspace
> code without the need to install a #DoIt method.
> 
> What is the reason for having the #DoIt scheme?  Is that reason still valid?

One reson (I don't know if it is the deepest one) is that many times your
doits have natural receivers, like in debuggers and inspectors, which they
couldn't have unless they were installed as methods in the receiver's
class's MethodDictionary.

OK, perhaps: Say the doit were compiled into a block, and you set the
'receiver' (I think it is called the sender) of that block to your receiver.
But since block semantics are a little different, that would probably not be
a good idea. For instance, you couldn't declare temp variables in your
doits.

Henrik






More information about the Squeak-dev mailing list