Dynamic scoping

Stephen Pair spair at acm.org
Fri Jan 31 21:40:59 UTC 2003

Lex Spoon wrote:

> The blocks approach may make more sense in Self, where people 
> are used to the ambiguity of variables and methods.

This is an interesting observation.  In fact, in a Self like system, if
designed to allow any kind of object to be a selector (and given some
syntactic construct for invoking non-symbolicly keyed slots)...you
wouldn't need any additional dictionary like construct.  Inserting items
would involve using some reflection protocol to install a slot, and
messages would be used to access them.

Conversely, dictionaries could be made more intelligent such that
associations could either contain a direct value, or some computed value
(using a block).  And, such blocks could even be made to resemble
methods where their receiver context was the dictionary itself.  Thus,
what you would have is a sort of encapsulated object with named slots.
Method invocation could potentially happen when using #at:.

Given this observation, I'd say that there is essentially no difference
between direct variable access (using at: and at:put: for example), and
access through method invocation; and there would likely not be much
difference implementing security in the context of either approach.

- Stephen

More information about the Squeak-dev mailing list