or body& is a pure function. The formal parameters are (or ), , etc.

is a pure function with a single formal parameter x.

is a pure function with a list of formal parameters.


  • When Function[body] or body& is applied to a set of arguments, (or ) is replaced by the first argument, by the second, and so on. is replaced by the function itself.
  • If there are more arguments supplied than # i in the function, the remaining arguments are ignored. »
  • stands for the sequence of all arguments supplied. »
  • ## n stands for arguments from number n onward. »
  • When applied to an association, is equivalent to , and picks out elements in the association.
  • In the form , the characters in name can be any combination of alphanumeric characters not beginning with digits.
  • Function[x,body] can be input as , where the character is entered as EscfnEsc or \[Function].
  • Function is analogous to λ in LISP or formal logic.
  • Function has attribute HoldAll. The function body is evaluated only after the formal parameters have been replaced by arguments.
  • The named formal parameters in Function[{x1,},body] are treated as local, and are renamed when necessary to avoid confusion with actual arguments supplied to the function. »
  • Function constructs can be nested in any way. Each is treated as a scoping construct, with named inner variables being renamed if necessary. »
  • Function[params,body,{attr1,attr2,}] represents a pure function that is to be treated as having attributes for the purpose of evaluation. »
Introduced in 1988
| Updated in 2014
Translate this page: