Dynamic scoping (was: Proposal: Squeak-E = Squeak x Kernel-E)

Avi Bryant avi at beta4.com
Mon Jan 27 19:12:20 UTC 2003

On Mon, 27 Jan 2003, Stephen Pair wrote:

> Have you looked at RuntimeEnvironments (on SqueakMap)?  They accomplish
> the same effect, but they are cleaner than using exceptions...

By whose definition of cleaner? ;)

I find using exceptions preferable for at least two reasons:

 - the semantics of dynamic scope are defined by the context stack, not
by Process.  There is not always a one-one relationship here.  If you
use a dynamic scoping mechanism that walks the context stack, you get the
correct behavior for free when working with constructs like Continuation.
RuntimeEnvironments would require special treatment to work across
coroutining or continuation invocation.

 - a mechanism based purely on exceptions is likely to be fairly portable,
and also likely to make good use of primitives


More information about the Squeak-dev mailing list