Closing (data-processing)
See also: Closing
In a Computer programming language, a closing is a function which captures references to free variables of its lexical environment which are not aggregate variables. A closing is thus created when a function is defined in the body of another function and refers to local variables or arguments of the function in which it is defined.
A closing can be last in parameter of a function in the environment where it was created (passed to the bottom ) or was returned like value of return (last to the top ). In this case, the problem arising then from closing is that it refers to data which would typically have been allocated in the pile, and are désallouées at the exit of the environment. Except optimizations by the compiler, the problem is generally solved by an allowance on the heap of the environment.
Example, in Common Lisp, of a function which returns a predicate, truth if its argument is larger than a certain minimum:
The closing created in create-predicate-more-large-that captures in its lexical environment the variable min .
| Random links: | Avenue | Equip Volksbank cyclist | Two pups in danger | Kachuu went | Junior (television program) | 4.6x30mm |