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

Avi Bryant avi at beta4.com
Mon Jan 27 20:12:20 CET 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

Avi



More information about the Squeak-dev mailing list

Squeak-dev list courtesy of The InternetOne and tric, the new way