|
|
|
|
|
by TeMPOraL
3280 days ago
|
|
> Messages might be linear but scopes are encompassing inner scopes. Encapsulation is not usually depicted as a stack. It can be, as concentric circles and stacks are isomorphic. What can be represented by one can be represented by other. Examples of dealing with scopes as stacks would probably be familiar to anyone working with C, C++ and other languages with stack-based local variables - your scopes there literally correspond to what's on a stack. Similarly, lexical scoping can be seen as a sequence (i.e. a stack) of associative containers. (Hell, you can see concentric circless as a Tower of Hanoi viewed from top - i.e. a stack (albeit inverted in this case - I'd put the innermost circle at the bottom of the stack).) I understand GP's pain because I too would prefer the same diagram as a simple stack of abstraction layers. But then again, such diagrams almost never work without corresponding textual explanation anyways, so it doesn't matter much how the diagram looks as long as the companion text is OK :). |
|