Talk:Closure (computer programming)/to do
Appearance
- Introduction
- Rewrite lead paragraph
- Closure = Function + Environment
- What happens when creating a closure? (Closure captures the current lexical environment)
- What happens when entering a closure? (Function is executed in the lexical environemnt captured by the closure)
- Add an introductory section
- Targeted primarily at imperative programmers who have little experience with non-local variables
- Rewrite lead paragraph
- History
- Early languages: POP-2
- Semantics
- Closure (computer programming)#Differences in semantics: Scheme (variables in scope) vs. Smalltalk (variables + return + self) vs, Java 7/8/... (variables + return + this + exceptions + ...)
- Implementation
- Luca Cardelli, Compiling a Functional Language.
- Simon Peyton Jones, Implementation of Functional Programming Languages.
- Z. Shao and A. W. Appel. Space-efficient closure representations.
- Upvalues: Roberto Ierusalimschy et al., "The Implementation of Lua 5.0"
- Applications: thunk (delayed computation), memoization, object system, hidden state/static variables
- Closure (computer programming)#Closures and state representation: This can be used in lazy pure languages as well, e.g. storing a memoization table in the closure which is lazyily evaluated when needed but not discarded.