离散数学中的闭包和计算机语言中的闭包有联系吗?

关注者
168
被浏览
17848

6 个回答

根据Wikipedia条目(en.wikipedia.org/wiki/C#History_and_etymology),尤其是注解4、5、6,可知计算机语言中的clourse用法是P.J. Landin发明的,意思其实就是closed expression。即lambda表达式中本来open的bindings(即free variables)被close后的结果。

没有证据表明Landin创造的这个术语与数学中的closure概念有直接的关系。@Ivony 的说法我认为只是源于两者用了相同的词汇,所以必然与close这个单词的意思相关而已。
没有半点关系,SICP里第二章注释6:

The use of the word ``closure'' here comes from abstract algebra, where a set of elements is said to be closed under an operation if applying the operation to elements in the set produces an element that is again an element of the set. The Lisp community also (unfortunately) uses the word ``closure'' to describe a totally unrelated concept: A closure is an implementation technique for representing procedures with free variables.
为什么?