Friday, February 25, 2005

Closures

According to word iQ:

In programming languages, a closure is an abstraction representing a function, plus the lexical environment (see static scoping) in which the function was created.

Closures are typically implemented with a special data structure that contains a pointer to the function code, plus a representation of the function's lexical environment (ie, the set of available variables and their values) at the time when the closure was created.

Closures typically appear in languages that allow functions to be "first-class" values --- in other words, such languages allow functions to be passed as arguments, returned from function calls, bound to variable names, etc, just like simpler types such as strings and integers.

0 Comments:

Post a Comment

<< Home