Talk:Closure (computer programming): Difference between revisions

Content deleted Content added
Line 794:
 
I think that the first example with ''function startAt(x)'' should explain from where the variable ''y'' comes and how it gets its value changed. This is implicitly told below the example by giving the result for <code>closure<sub>1</sub></code> & <code>closure<sub>2</sub></code>, but a verbal explanation is missing.--[[User:Sae1962|Sae1962]] ([[User talk:Sae1962|talk]]) 12:12, 5 February 2015 (UTC)
 
== Functions in C -- Clarity recommended... ==
 
''Closures typically appear in languages in which functions are first-class values—in other words, such languages enable functions to be passed as arguments, returned from function calls, bound to variable names, etc., just like simpler types such as strings and integers.''
 
Earlier, it is indicated that 'c' is not such a language, and does not allow nested functions, but, in essence, via pointers, it does. You cannot expressly pass a function, but you can pass a pointer to a function, and this allows you to do some stuff that looks remarkably indistinguishable from those used in the examples of legitimate usage of closures.
 
I'm not arguing agains the claim, but suggesting that it would be good to discuss this somewhere as to how it differs.[[Special:Contributions/167.230.96.8|167.230.96.8]] ([[User talk:167.230.96.8|talk]]) 20:04, 13 May 2015 (UTC)