Indefinite Scope

Indefinite scope is a name resolution rule which is not contained by Lexical Scope. When the program refers to an object using an indefinitely scoped name, the reference is resolved not by looking for the closest physically surrounding construct which lexically binds that name, but rather a broader search strategy. The binding may either exist in the global environment, or may have been established in some distant part of the program in an expression which invoked the current expression directly, or through any number of intermediate frames. To this is a kind of scoping-at-a-distance. It doesn't have to be implemented as a complicated search through the chain of activation frames at all, but rather, for instance, by a saving and restoring discipline over entries in a binding environment of which there is one instance for each thread.

Indefinite Scope naturally combines with Dynamic Extent, and this combination is known as Dynamic Scoping.


See original on c2.com