Mozilla/5.0 (Macintosh; Intel Mac OS X 10.7; rv:8.0) Gecko/20111105 Thunderbird/8.0
On 1/31/12 8:47 AM, Greg Wooledge wrote:
> On Mon, Jan 30, 2012 at 09:32:14PM -0600, Peng Yu wrote:
>>> What do you mean by "closure"?
>>
>> See here for the explanation of closure.
>> http://en.wikipedia.org/wiki/Closure_%28computer_science%29
>
> "In computer science, a closure (also lexical closure, function closure,
> function value or functional value) is a function together with a referencing
> environment for the non-local variables of that function.[1] A closure allows
> a function to access variables outside its typical scope."
It's just another encapsulation mechanism. The shell's most useful
equivalent is the shell script, since, as you noted, the process
environment is fragile when used for this.
--
``The lyf so short, the craft so long to lerne.'' - Chaucer
``Ars longa, vita brevis'' - Hippocrates
Chet Ramey, ITS, CWRU address@hidden http://cnswww.cns.cwru.edu/~chet/