next up previous contents
Next: CLAM Pattern Up: General Programming Patterns Previous: General Programming Patterns   Contents

Closure Pattern

The most fundamental of the general programming patterns derived from ARS is the closure pattern. A closure is an encapsulation of a lambda abstraction with its total environment. This environment consists of all the names that this lambda abstraction has access to. Access to names in a lambda abstraction is controlled by the so called `lexical scope'. Lexical scope can also be described as the context of a lambda abstraction in the program text. A detailed explanation is given in the book Programmierung pur.

A closure is a first class object, which means that it can be treated like any data item:

The slight difference between a closure and an object in OOP is the following:
next up previous contents
Next: CLAM Pattern Up: General Programming Patterns Previous: General Programming Patterns   Contents
Georg P. Loczewski 2002-07-20
ORDER NOW!!!