Talk:First-class function: Difference between revisions

Content deleted Content added
SineBot (talk | contribs)
Line 225:
 
Functional languages must support first-class functions BY DESIGN (in language semantics itself),- not recursively/dynamically invoking compiler as in your example or not by doing some other metaprogramming stuff. Otherwise by using your logic we can conclude that ANY compiled language supports functional programming (or any other programming idiom, just by invoking compiler dynamically). Which will sound crazy [and leave language designers unemployed :) ], don`t you think ? So let`s face it - C/C++ was not designed as modern functional language, and it will stay as it is, unless ... will be re-designed by it`s designers :-) <span style="font-size: smaller;" class="autosigned">—Preceding [[Wikipedia:Signatures|unsigned]] comment added by [[Special:Contributions/84.32.222.96|84.32.222.96]] ([[User talk:84.32.222.96|talk]]) 17:50, 22 February 2010 (UTC)</span><!-- Template:UnsignedIP --> <!--Autosigned by SineBot-->
 
== New 'Comparison' Section has wrong focus ==
It is about what haskel can do with its functions rather than about first class functions. They are not the same thing. The former is a superset of the latter.<br>
Integers would be first class in most languages and whilst you would be able to pass them into and out of functions, you cannot curry an integer or lazily evaluate it, or create a closure on it.
 
The things you can do with a first class ''integer'' include passing it to and from a function; creating new integers from other integers in expressions; and having integers of members of collection datatypes such as lists and sets. If a language has first class integers, and you can do what you can do with integers with its functions, then the functions are every bit as first class as the languages integers. Or would integers in the language be thought of as second class?
 
I think this new section should be trimmed. --[[User:Paddy3118|Paddy]] ([[User talk:Paddy3118|talk]]) 18:43, 13 July 2010 (UTC)