Anonymous function: Difference between revisions

Content deleted Content added
Filled in 1 bare reference(s) with reFill 2
No edit summary
Line 1:
{{short description|Function definition that is not bound to an identifier}}
In [[computer programming]], an '''anonymous function''' ('''function literal''', '''lambda abstraction''', '''lambda function''', '''lambda expression''' or '''block''') is a [[Function (computer science)|function]] definition that is not [[name binding|bound]] to an [[Name (computer science)|identifier]]. Anonymous functions are often arguments being passed to [[higher-order function]]s or used for constructing the result of a higher-order function that needs to return a function.<ref>{{cite web |title=Higher order functions |url=http://learnyouahaskell.com/higher-order-functions |access-date=3 December 2014 |website= |publisher=learnyouahaskell.com |language=en-US}}</ref>
If the function is only used once, or a limited number of times, an anonymous function may be syntactically lighter than using a named function. Anonymous functions are ubiquitous in [[functional programming language]]s and other languages with [[first-class function]]s, where they fulfil the same role for the [[function type]] as [[literal (computer programming)|literals]] do for other [[data type]]s.