Jump to content
Main menu
Main menu
move to sidebar
hide
Navigation
Main page
Recent changes
Random page
Help about MediaWiki
Special pages
Niidae Wiki
Search
Search
Appearance
Create account
Log in
Personal tools
Create account
Log in
Pages for logged out editors
learn more
Contributions
Talk
Editing
Lambda calculus
(section)
Page
Discussion
English
Read
Edit
View history
Tools
Tools
move to sidebar
hide
Actions
Read
Edit
View history
General
What links here
Related changes
Page information
Appearance
move to sidebar
hide
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
=== Anonymous functions === {{Further|Anonymous function}} For example, in [[Python (programming language)|Python]] the "square" function can be expressed as a lambda expression as follows: <!-- Please do not add the same example in different languages to this article, see Anonymous function for that. Thank you! --> <syntaxhighlight lang="Python"> (lambda x: x**2) </syntaxhighlight> The above example is an expression that evaluates to a first-class function. The symbol <code>lambda</code> creates an anonymous function, given a list of parameter names, <code>x</code> β just a single argument in this case, and an expression that is evaluated as the body of the function, <code>x**2</code>. Anonymous functions are sometimes called lambda expressions. For example, [[Pascal (programming language)|Pascal]] and many other imperative languages have long supported passing [[Function (computer programming)|subprograms]] as [[Parameter (computer programming)|arguments]] to other subprograms through the mechanism of [[function pointer]]s. However, function pointers are an insufficient condition for functions to be [[First-class function|first class]] datatypes, because a function is a first class datatype if and only if new instances of the function can be created at [[Execution (computing)#runtime|runtime]]. Such runtime creation of functions is supported in [[Smalltalk]], [[JavaScript]], [[Wolfram Language]], and more recently in [[Scala (programming language)|Scala]], [[Eiffel (programming language)|Eiffel]] (as agents), [[C Sharp (programming language)|C#]] (as delegates) and [[C++11]], among others.
Summary:
Please note that all contributions to Niidae Wiki may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see
Encyclopedia:Copyrights
for details).
Do not submit copyrighted work without permission!
Cancel
Editing help
(opens in new window)
Search
Search
Editing
Lambda calculus
(section)
Add topic