Content deleted Content added
m Signing comment by BryanFrazar - "→Language Support table: Added F# to the list of languages missing from the table." |
Jerryobject (talk | contribs) m WP:LINKs: updates, WP:Disambiguates, fix-cut WP:NOPIPE, needless underscores. |
||
Line 4:
==Language Support table==
The [[First-
* [[R (programming language)|R]]
* [[F Sharp (programming language)|F#]] (under "Functional Languages") <small><span class="autosigned">— Preceding [[Wikipedia:Signatures|unsigned]] comment added by [[User:BryanFrazar|BryanFrazar]] ([[User talk:BryanFrazar|talk]] • [[Special:Contributions/BryanFrazar|contribs]]) 20:35, 6 January 2015 (UTC)</span></small><!-- Template:Unsigned --> <!--Autosigned by SineBot-->
Please add a language to the list if it is missing from the table. Put higher priority languages higher on the list. Please remove a language if it has been added to the table. --[[User:Hierarchivist|Hierarchivist]] ([[User talk:Hierarchivist|talk]]) 21:51, 7 May 2014 (UTC)
Line 12:
"Most modern programming languages support functions defined statically at compile time. C additionally supports function pointers, which can be stored in data structures and passed as arguments to other functions. Nevertheless, C is not considered to support first class functions, since in general functions cannot be created dynamically during the execution of a program. The closest analog in C is that of a dynamically compiled function created by a just-in-time compiler, which is compiled as an array of machine language instructions in memory and then cast to a function pointer. However, this technique is specific to the underlying hardware architecture and is therefore neither general nor portable."
:I have problems with this. The main thing is that the attempt to find an analog in C seems pointless to me. I wouldn't try to find an analog of 'break' in Lisp, although I'm sure I could find something not too dissimilar if I strained hard enough. In turn, I don't think it's conducive to understanding of the first class function to compare it to something like int (*f)(). Of course it is perfectly feasible to write C code to write a bit of C, compile it, put it into a dynamically linked library, open the library and execute it--in fact, this was even easier in [[
::Well, I was trying to pre-empty a potential argument that the presence of function pointers in C is the same as having first class functions. What are the crucial properties a function object has to have in order to qualify as first-class? You can pass function pointers as arguments to other functions, and you can store them in memory and other data structures; in these respects function pointers and first class functions are indeed similar. What distinguishes function pointers from first class functions is that the only values a function pointer can take on are the addressed of functions defined at compile/link time. However, due to the presence of casts (nothing stops you from casting arbitrary pointers to function pointers), this is not literally true, but those casts are really only useful for in-memory compilation. Since C directly supports function pointers and casts in the language, it makes sense to point out that these features don't add up to first class functions, with which they nevertheless share some properties. --[[User:MarkSweep|MarkSweep]] 07:08, 13 Nov 2004 (UTC)
Line 205:
: [[User:Pohta ce-am pohtit|Pcap]] [[User_talk:Pohta ce-am pohtit|<small>ping</small>]] 03:20, 24 August 2009 (UTC)
::First-classness is interesting for many kinds of objects other than functions. For example, in most static languages -- such as [[Simula
::As for the relationship between first-class functions and function literals, it is surely not an equality. But anonymous function literals are a pretty trivial subject compared to first-class functions, so I think it makes sense to treat them as a section within [[first-class
::: Did you read my summary of the references [[Talk:First-class_object#In_references|there]]? Some sources consider functions in C first class, even though C has no function literals. This was actually pointed out repeatedly by multiple editors. [[User:Pohta ce-am pohtit|Pcap]] [[User_talk:Pohta ce-am pohtit|<small>ping</small>]] 05:32, 24 August 2009 (UTC)
|