Content deleted Content added
→C has first-class functions (revisited): new section |
|||
Line 421:
--[[User:Widged|Widged]] ([[User talk:Widged|talk]]) 21:12, 13 March 2012 (UTC)
== C has first-class functions (revisited) ==
Back in 2010 someone pointed out that Apple's C supports anonymous functions called "blocks". I don't know much about all the various versions of C, but Apple writes that "Blocks are available in GCC and Clang as shipped with the OS X v10.6 Xcode developer tools" (See [https://developer.apple.com/library/ios/documentation/cocoa/Conceptual/Blocks/Articles/00_Introduction.html#//apple_ref/doc/uid/TP40007502-CH1-SW1 iOS Developer Library:Blocks Programming Topics]). So what version of C is this?
Blocks can assigned to variable, passed to functions, returned as values from functions. The block can refer to variables in the scope that they were defined and use persistent storage for the local variables if the function returns. In other words, I think they thought of everything as far as I can see. Thus this version of C has first class functions.
This info should be added to the table and the text, otherwise this article is in error. ---- [[User:CharlesGillingham|CharlesGillingham]] ([[User talk:CharlesGillingham|talk]]) 01:19, 1 November 2014 (UTC)
|