Programming language - GradedJestRisk/lexicon GitHub Wiki
| Name | Typing | Type-checking | Functional | ||
|---|---|---|---|---|---|
| Name | Static | Dynamic | Strong | Weak | |
| JavaScript | _ | X | _ | X | X |
| Python | _ | X | X | _ | X |
| Perl | X (use strict) | X | X | _ | X |
| Java | X | _ | X | _ | X |
An anonymous function (function literal, lambda abstraction, or lambda expression) is a function definition that is not bound to an identifier.
Do with functions what you can do with primitive types
- create it ?
- pass it as an argument
- return it
PL have first-class functions if it treats functions as first-class citizens.
A first-class citizen (also type, object, entity, or value) in a given programming language is an entity which supports all the operations generally available to other entities. These operations typically include being passed as an argument, returned from a function, modified, and assigned to a variable.
In mathematics and computer science, a higher-order function is a function that does at least one of the following:
- takes one or more functions as arguments (i.e. procedural parameters),
- returns a function as its result.
const twice = (f, v) => f(f(v)); const add3 = v => v + 3; twice(add3, 7); // ((7 + 3) + 3) = 13
All functions, but high-order, are first-order functions