Full Block Closure

Jan Theodore Galkowski algebraist at salonmember.com
Thu Nov 25 04:11:01 UTC 1999


On Thu, 18 Nov 1999 16:20:14   Craig Latta wrote:
>
>> > Actually, Squeak does support temporary block variables.
>>
>> Eh, sort of, yes. But only by making them temps of the method in
>> which the block occurs, yes? (You should know :)) The temps aren't
>> local to the block, right?
>
>	That's right. If you don't need a distinct variable in an inner scope with the same name as one in an outer scope, you won't notice.

[snip]

The closures I'm familiar with are like the
"contexts" or, rather, "c-txts" of the
"SCHEME: The Ultimate Declarative" world.
I found these most impressively implemented
in a LISP by IBM Research called LISP/370
where one had a b.i.f. called "state" which
returned a pointer to such a context.  So,
if one did

   (SETQ P (STATE))

at some point, and hung onto P, one could 
do, say,

   (SETQ Z (EVAL x P))

at some arbitrary point later, and whatever
"x" was was evaluated w.r.t. the bindings
current at P, in other words, in the context
at the point "(STATE)" was done.  

There was one "hole" in this scheme through
which information could be passed.  That was
in the value which 

    (EVAL (STATE) P) 

returned.  If it was null, then you knew you
weren't in a primary instance of the context
but in a copied or retained one.  This, of 
course, could be interrogated. 

This long digression indicates, I hope, how 
side-tracked this business can get.  Essentially, if one wants to hack the
lambda calculus -- in the spirit of 
combinators, say -- there are all kinds of
possibilities once one assigns procedural
interpretations to various things.  

I think the magic of Smalltalk is that
everyone is local -- given in messages --
and that context is minimized.  Yes, one
could worry about passing large messages
around and how to finesse' that.  But why
do so if it is a new computational model?
If closures are the canonical form for things
to be passed around, that might say something,
but that's an important decision of principle
and design.  And closures, at least to my
recollection, are a way of allowing standard
procedural constructs to survive in a 
highly decentralized world.

But we don't want to do that.  We already
have an alternative computational model.
Right?

---
___________________________________________
demiourgos at smalltalk.org        squeak.org/
home.stny.rr.com/algebraist/ 
www.smalltalk.org/ jtgalkowski at alum.mit.edu




Get your FREE, private e-mail account at http://www.salonmember.com.





More information about the Squeak-dev mailing list