cloning/invocation (was: real metalevel)

Jecel Assumpcao Jr jecel at merlintec.com
Tue Aug 27 18:53:18 UTC 2002


On Tuesday 27 August 2002 05:45, Marcel Weiher wrote:
> Sorry, but I also find "invoke with arguments" easier to *think*
> about than "make a copy, modify the copy, do something with the
> copy", essentially because it is declarative.  In fact, I currently
> see/use it the other way around:  making a copy and munging that is a
> (hidden) implementation of a parametrized object.

We will have to agree to disagree, then :-)

I see making a copy as changing the semantics. Without a copy, two 
different invocations of a method would share temporary variables and 
arguments. With a copy, each one has a separate state.

Of course, the declarative "invoke with arguments" will almost certainly 
have implicitly in its semantics some form of copying. I am just 
stating explicitly that this is what is happening.

> This is pretty much where I think self went off in the wrong
> direction, unifying too many different (if related) ideas with
> low-level/imperative/time-dependent mechanisms and then having to
> untangle the mess again, with great difficulty.

Who has to untangle the mess? The user or the implementor? If only the 
latter, then I don't see the problem.

> Yes, you can get away with tossing things like classes (and method
> invocation), but while an interesting intellectual exercise, you
> aren't actually helping your users, IMHO.

It is great fun to grab some object on the screen and then patch it 
until it is a new thing. Fun is important and helps users.

> > That is the story we tell (but don't actually implement ;-) in
> > Self: contexts (called activation objects) are created by cloning
> > methods and then changing them.
>
> Once again, that seems like backwards to me:  turning a simple
> invocation into something conceptually more complex (time-dependent
> etc.), then optimizing that away again.
>
> Why not present the simple model to the user?

Because I think this is the simple model. Compare this with the model 
presented in the Blue Book (which can also be seen in the Interpreter 
class in Squeak). You will probably tell me that the "normal" 
Smalltalker doesn't have to learn about stack pointers, method headers, 
context objects, etc. Then I will say that the normal Selfish 
programmer doesn't have to know that activation objects are obtained 
from cloning method objects!

There are several level of models. Let us make sure we are comparing 
comparable ones.

-- Jecel



More information about the Squeak-dev mailing list