Closures

September 4, 2020 · View on GitHub

The Concept

A closure is the use of one or more variables in an inner lexical scope from an outer lexical scope. Historically, this nomenclature was derived from λ-calculus and popularized by scheme (source) to reference a function's open and closed variable bindings.

What to cover

  • What a closure is. What makes up a closure in your language?
  • How to define a clojure. Does it occur transparently (like JavaScript)? Is it explicit (like PHP)? What syntax?
  • How to use a clojure. What can you use it for? Dynamic functions, function composition, memoizing, callbacks?

Implementations

TrackExerciseChanges
JavaScriptclosuresNone