[ << ] | [ < ] | [ Up ] | [ > ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
3.4 The Concept of Closure
The concept of closure is the idea that a lambda expression “captures” the variable bindings that are in lexical scope at the point where the lambda expression occurs. The procedure created by the lambda expression can refer to and mutate the captured bindings, and the values of those bindings persist between procedure calls.
This section explains and explores the various parts of this idea in more detail.
3.4.1 Names, Locations, Values and Environments | Names, locations, values and environments. | |
3.4.2 Local Variables and Environments | Local variables and local environments. | |
3.4.3 Environment Chaining | Environment chaining. | |
3.4.4 Lexical Scope | The meaning of lexical scoping. | |
3.4.5 Closure | Explaining the concept of closure. | |
3.4.6 Example 1: A Serial Number Generator | Example 1: a serial number generator. | |
3.4.7 Example 2: A Shared Persistent Variable | Example 2: a shared persistent variable. | |
3.4.8 Example 3: The Callback Closure Problem | Example 3: the callback closure problem. | |
3.4.9 Example 4: Object Orientation | Example 4: object orientation. |
[ << ] | [ < ] | [ Up ] | [ > ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
This document was generated on April 20, 2013 using texi2html 5.0.