| |
| | Dynamic Scoping |
 | | In lexical scoping (and if you're the interpreter), you search in the local function (the function which is running now), then you search in the function (or scope) in which that function was defined, then you search in the function (scope) in which that function was defined, and so forth. |
 | | In dynamic scoping, by contrast, you search in the local function first, then you search in the function that called the local function, then you search in the function that called that function, and so on, up the call stack. |
 | | Dynamic scoping is useful as a substitute for globally scoped variables. |
| c2.com /cgi/wiki?DynamicScoping (965 words) |
|