Talk:Closure (computer programming): Difference between revisions

Content deleted Content added
Ruud Koot (talk | contribs)
Line 805:
: There is some discussion about this at [[First-class function#Non-local variables and closures]]. —''[[User:Ruud Koot|Ruud]]'' 13:28, 14 May 2015 (UTC)
I'm confused about the claim that C doesn't support nested functions; recursion is a standard technique in C, so it clearly does support nested functions. It doesn't directly support passing a function as a value, so they aren't first-class values. It doesn't support closures, due to not being able to execute the function after the enclosing function has exited, but that is the other case. This wording seems almost like a typo, but I'm not fluent enough in Algol to make that edit. Perhaps the source of my confusion is that C doesn't allow nested function definitions. If so, perhaps clarifying that would help other readers with a similar confusion.--[[User:Wcoole|Wcoole]] ([[User talk:Wcoole|talk]]) 23:08, 21 October 2015 (UTC)
 
== Capture-by-value in the lead section ==
 
{{ping|Maggyero}} I'm not sure if I completely agree with [https://en.wikipedia.org/w/index.php?title=Closure_%28computer_programming%29&type=revision&diff=729749204&oldid=723316111 these] changes to the lead section. These changes allow for the possibility of a closure capturing variables by value instead of by reference. If feel this distinction is overly pedantic for the lead section, and makes it even harder to understand. Especially considering that the distinction only makes sense at all in imperative languages/language where variables are mutable, and even more so since C++ is the only language I'm aware of that allows capturing by value. Instead I'd suggest assuming immutable variables/capture-by-reference semantics in the lead and go into more detail on capture-by-value in a footnote and/or separate section on closures in imperative languages. —''[[User:Ruud Koot|Ruud]]'' 15:08, 14 July 2016 (UTC)