Questions - RE: Dynamic scoping

Stephen Pair spair at acm.org
Wed Jan 29 20:50:48 UTC 2003


> > I would focus on keeping Continuation as simple as possible 
> (so that 
> > its semantics are relatively easy to grok), yet make it 
> robust enough 
> > to satisfy some common needs (like not having to abuse 
> blocks in this 
> > way and doing the right thing wrt to dynamic scoping).
> 
> But that's exactly the point - ideally Continuation should do 
> nothing more than copy the stack.  No special cases.  

Well, except that the continuation itself is a special case.  You happen
to be tacking a limited set of objects and giving them a limited set of
transactional semantics.  If you really wanted to do it without special
casing, you'd make all objects in the system exhibit transactional
properties, including context objects.

But, since that is not likely to be a practical solution any time soon,
continuation is a handy approximation.  And, it's not likely that you'll
be able to achieve all of the dynamic scoping constructs we've been
discussing, have them cleanly implemented in a single unified model and
make the constructs simple for the user (i.e. no [ :a | x := a ])
without some impact on continuations.  But the impact could be extremely
small...to the point of a continuation simply saying "stack
isolateDynamicContext" at the point of continuation.

- Stephen



More information about the Squeak-dev mailing list