Talk:First-class function: Difference between revisions

Content deleted Content added
Ruud Koot (talk | contribs)
Ruud Koot (talk | contribs)
Line 297:
 
: I'd prefer to have a simple table comparing language features (support for higher-order function, function types as the return type, anonymous functions, anonymous function that can refer to various outside their body, etc.) over a plain statement that language ''X'' has "first-class" functions or not. —''[[User:Ruud Koot|Ruud]]'' 10:54, 17 February 2011 (UTC)
 
: For your peace of mind: Python has first-class functions and reference equality:
<source lang="python">
>>> def main():
... a = 3
... b = 1
... return (lambda ls: map(lambda x: a * x + b, ls))
...
>>> main()([1,2,3,4,5])
>>> (lambda x: x) == (lambda x: x)
False
[4, 7, 10, 13, 16]
</source>