Talk:Closure (computer programming): Difference between revisions

Content deleted Content added
Ruud Koot (talk | contribs)
Ruud Koot (talk | contribs)
Line 640:
:+1 --[[User:Paddy3118|Paddy]] ([[User talk:Paddy3118|talk]]) 17:04, 1 April 2011 (UTC)
 
: The first sentence could be improved, but I don't think your suggestion is an improvement. You sort of try to define "first-class function" and "closing over the lexical scope", but do so in a incorrect and non-universal way. E.g. "pass around like object" probably only makes sense to people coming from an OO background. A closure doesn't "remember the values", it gives you access to the variables itself (I initially made the same mistake [http://en.wikipedia.org/w/index.php?title=First-class_function&action=historysubmit&diff=413714790&oldid=413713398 here]). You also need to be explicit about which scope you're talking, in this case the lexical scope, not the dynamic scope. This again might be "obvious" for people coming from a particular language, but isn't universal. Your definition simply leaves out the second sentence from the current definition altogether. I think a concrete example, as in [[First-class function#Closures]] would be more instructive. —''[[User:Ruud Koot|Ruud]]'' 12:43, 2 April 2011 (UTC)