List of Languages
The following is a list of programming languages that fully support unnamed anonymous functions; support some variant of anonymous functions; and have no support for anonymous functions.
This table shows some general trends. First, the languages that do not support anonymous functions—C, Pascal, Object Pascal, Java—are all conventional statically typed languages. This does not, however, mean that statically typed languages are incapable of supporting anonymous functions. For example, the ML languages are statically typed and fundamentally include anonymous functions, and Delphi, a dialect of Object Pascal, has been extended to support anonymous functions. Second, the languages that treat functions as first-class functions—Dylan, JavaScript, Lisp, Scheme, ML, Haskell, Python, Ruby, Perl—generally have anonymous function support so that functions can be defined and passed around as easily as other data types. However, the new C++11 standard adds them to C++, even though this is a conventional, statically typed language.
- This list is incomplete; you can help by expanding it.
Language | Support | Notes |
---|---|---|
ActionScript | Y | |
Ada | N | |
C | N | Support is provided in clang and along with the llvm compiler-rt lib. GCC support is given for a macro implementation which enables the possibility of usage. Details see below. |
C# | Y | |
C++ | Y | As of the C++11 standard |
Clojure | Y | |
Curl | Y | |
D | Y | |
Dart | Y | |
Dylan | Y | |
Erlang | Y | |
F# | Y | |
Frink | Y | |
Go | Y | |
Groovy | Y | |
Haskell | Y | |
Java | N | Planned for Java 8 |
JavaScript | Y | |
Lisp | Y | |
Logtalk | Y | |
Lua | Y | |
Mathematica | Y | |
Maple | Y | |
Matlab | Y | |
Maxima | Y | |
ML languages (OCaml, Standard ML, etc.) |
Y | |
Octave | Y | |
Object Pascal | Y | Delphi, a dialect of Object Pascal, implements support for anonymous functions (formally, anonymous methods) natively since Delphi 2009. The Oxygene Object Pascal dialect also supports them. |
Objective-C (Mac OS X 10.6+) | Y | called blocks; in addition to Objective-C, blocks can also be used on C and C++ when programming on Apple's platform |
Pascal | N | |
Perl | Y | |
PHP | Y | As of PHP 5.3.0, true anonymous functions are supported; previously only partial anonymous functions were supported, which worked much like C#'s implementation. |
Python | Y | Python supports anonymous functions through the lambda syntax, in which you can only use expressions (and not statements). |
R | Y | |
Racket | Y | |
Ruby | Y | Ruby's anonymous functions, inherited from Smalltalk, are called blocks. |
Scala | Y | |
Scheme | Y | |
Smalltalk | Y | Smalltalk's anonymous functions are called blocks. |
TypeScript | Y | |
Tcl | Y | |
Vala | Y | |
Visual Basic .NET v9 | Y | |
Visual Prolog v 7.2 | Y |
Read more about this topic: Anonymous Function
Famous quotes containing the words list of, list and/or languages:
“Modern tourist guides have helped raised tourist expectations. And they have provided the nativesfrom Kaiser Wilhelm down to the villagers of Chichacestenangowith a detailed and itemized list of what is expected of them and when. These are the up-to- date scripts for actors on the tourists stage.”
—Daniel J. Boorstin (b. 1914)
“Loves boat has been shattered against the life of everyday. You and I are quits, and its useless to draw up a list of mutual hurts, sorrows, and pains.”
—Vladimir Mayakovsky (18931930)
“The trouble with foreign languages is, you have to think before your speak.”
—Swedish proverb, trans. by Verne Moberg.