Content deleted Content added
Example and text don't match |
|||
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)
:: ''Nested functions'', in this contaxt, means ''lexically'' nested functions. Last time I used C, gcc supported them while standard C didn't. (The next question is then whether such functions can be closures, i.e. use variables defined in their lexical environment when invoked outside of that scope.) [[User:Rp|Rp]] ([[User talk:Rp|talk]]) 12:27, 20 March 2018 (UTC)
== Capture-by-value in the lead section ==
|