Locally defined functions

Functions defined within other function bodies are bound to names in a local frame.

Higher order function

A function that takes a function as an argument value or returns a function as a return value.
Useful:

  • Express general methods of computation
  • Remove repetition from programs
  • Each function has exactly one job

Environment

A sequence of frames. Created by calling a top-level function (no def within def) consists of one local frame, followed by the global frame.