Talk:Closure (computer programming): Difference between revisions

Content deleted Content added
Focus on state
Line 130:
 
:For now I changed the section title to "Implementation and Theory"--[[User:CarlHewitt|Carl Hewitt]] 16:53, 22 August 2005 (UTC)
 
== Focus on state ==
 
It seems to me that the focus on "storing information" is just wrong. Am I crazy? Google says:
 
Definitions that '''do not''' mention storing information: [http://www.csse.monash.edu.au/~lloyd/tildeProgLang/Glossary/] [http://www.gwydiondylan.org/books/dpg/db_348.html] [http://computing-dictionary.thefreedictionary.com/closure] ([http://www.cs.ecu.edu/~karl/astarte/glossary.html]--see ''function closure'') ([http://www.mulberrytech.com/dsssl/dsssldoc/glossary/glossary.html]--see ''lambda'') ([http://www.ai.mit.edu/projects/iiip/doc/CommonLISP/HyperSpec/Body/glo_l.html#lexical_closure]--see ''lexical closure'') [http://mindprod.com/jgloss/closure.html].
 
Definitions that '''do''' mention storing information: [http://community.schemewiki.org/?glossary].
 
Definitions that sort of imply it: [http://lamp.epfl.ch/~michelou/activities/projects/phd/glossary/].
 
In my experience, a closure is (a) in source code, a syntactical construct where the code for a function appears, and it has '''open variables''' that are declared not within the function, but outside, in its lexical scope; (b) at run-time, the implementation of that function, consisting of some code and a pointer to the environment (where the open variables live at run-time). You can assign to open variables in some languages, true; but a lot of functional languages don't let you assign to local variables ''at all''; this is hardly the essential, defining feature of closures. -- [[User:Jorend|Jorend]] 21:13, 10 January 2006 (UTC)