Everything about Closure (computer programming)
Technique for creating lexically scoped first class functions
In programming languages, a closure, also lexical closure or function closure, is a technique for implementing lexically scoped name binding in a language with first-class functions. Operationally, a closure is a record storing a function together with an environment. The environment is a mapping associating each free variable of the function with the value or reference to which the name was bound when the closure was created. Unlike a plain function, a closure allows the function to access those captured variables through the closure's copies of their values or references, even when the function is invoked outside their scope. Wikipedia →
đź§ Start here: a 6-step reading path
- Read the overview: Closure (computer programming)A 5-minute orientation
- Pick up a classic book: ClosureThe most-reprinted book on the subject
- Read the landmark paper: Closure to “Computer Programming for Flow over Side Weirs”Cited 4 times
- Go sideways: Examples of anonymous functionsA closely related topic
- Go sideways: First-class functionA closely related topic
đź“– Definitions
No dictionary entry for this exact phrase.
🗂️ The subject at a glance
🏆 Landmark papers (most cited)
📚 Books worth reading
ClosureMichael Bolin · 2010
Ranked by number of editions on Open Library, a rough measure of how lasting a book is.
đź”— Related topics
- Examples of anonymous functions In computer programming, an anonymous function (function literal, lambda function, or block) is a function definition that is not bound to an identifier…
- First-class function In computer science, a programming language is said to have first-class functions if it treats functions as first-class citizens. This means the language…
- Nested function In computer programming, a nested function (or nested procedure or subroutine) is a named function that is defined within another (enclosing) block and…
- Scope (computer programming) In computer programming, the scope of a name binding (an association of a name to an entity, such as a variable) is the part of a program in which the…
- Function object In computer programming, a function object is a construct allowing an object to be invoked or called as if it were an ordinary function, usually with the…
- This (computer programming) this, self, and Me are keywords used in some computer programming languages to refer to the object, class, or other entity which the currently running…
- Name resolution (programming languages) In programming languages, name resolution is the resolution of the tokens within program expressions to the intended program components. Expressions in…
- Funarg problem In computer science, the funarg problem (function argument problem) is the difficulty in implementing first-class functions (functions as first-class objects)…