Talk:Functional programming: Difference between revisions

Content deleted Content added
m Archiving 2 discussion(s) to Talk:Functional programming/Archive 3) (bot
Line 118:
:D is pretty similar to C. I found the example helpful in its familiarity. Even if it is unpopular (currently [http://langpop.com/ ranked 15th on langpop], over the other example languages) and despite any faults it may have for functional programming ({{citeneeded}}?), it is useful for examples just by being familiar to C-family programmers. --[[Special:Contributions/72.226.86.106|72.226.86.106]] ([[User talk:72.226.86.106|talk]]) 18:54, 10 July 2015 (UTC)
 
== The section on non-functional languages ==
== First-class functions and Python ==
 
<blockquote>First-class functions have slowly been added to mainstream languages. For example, in early 1994, support for lambda, filter, map, and reduce was added to Python. Then during the development of Python 3000, Guido van Rossum called for the removal of these features.[44] However, he later changed his mind, and only reduce was removed,[45] though it remains accessible via the functools standard library module.[46]</blockquote>
 
This seems to equate first-class functions with lambda, map, filter, and filterreduce. Even without those, Python treatshad first-class functions andfrom methodsthe as objects.beginning --[[Special(Guido:Contributions/72 ".226.86.106|72 I had made functions first-class objects.226.86.106]] ("[[User talkhttp:72//python-history.226blogspot.86de/2009/04/origins-of-pythons-functional-features.106|talk]html]). 18:31,Python 10shouldn't Julybe 2015listed (UTC)as a language that ''added'' first-class functions.
 
C/C++ has passing of function pointers, and C++ templating allow them to be used without fully specifying type. The C++ standard [http://www.cplusplus.com/reference/algorithm/ <code><algorithm></code> header] has many functions which take functions as parameters, and the [http://www.cplusplus.com/reference/functional/ <code><functional></code> header] helps make and use function objects. C++11 added ''anonymous'' function support, and those lambdas can have closures. Functions are no more and no less first-class than before.
 
Javascript deserves a mention. [[Douglas Crockford]] calls it a "Lisp in C's clothing".[http://www.crockford.com/javascript/javascript.html] It has first-class functions, closures, and anonymous functions, and it's common to pass functions as arguments.
--[[Special:Contributions/72.226.86.106|72.226.86.106]] ([[User talk:72.226.86.106|talk]]) 00:53, 11 July 2015 (UTC)