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


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.

\includegraphics[scale=0.70]{img/closure2.eps}
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 index
Next: CLAM Pattern Up: General Programming Patterns and Previous: General Programming Patterns and   Contents   Index
domain access counter Georg P. Loczewski 2004-03-05