Skip to content

Function ​

Generated from the engine's own definition: compute-engine's symbol, which we neither extend nor document by hand.

A function literal

✓ checked against that system · ! checked, with disagreements (hover a chip)Wolfram LanguageFunction✓
Function(expression, (function | symbol)*) -> functionas compute-engine declares it
Typed signatures
TypePackageApplies
(expression, (function | symbol)*) -> functioncompute-enginealways

Domain: Compute engine

Examples

Basic #
live ↗
In(u↦u+3)(x)(u↦u+3)(x)Outx+3x+3
live ↗
In(_1⁡↦_1⁡+3)(x)(\operatorname{\_1}↦\operatorname{\_1}+3)(x)Outx+3x+3
live ↗
In((u,v)↦v4+u2)(x,y)((u, v)↦v^4+u^2)(x, y)Outy4+x2y^4+x^2
live ↗
In((_1⁡,_2⁡)↦_2⁡4+_1⁡2)(x,y)((\operatorname{\_1}, \operatorname{\_2})↦\operatorname{\_2}^4+\operatorname{\_1}^2)(x, y)Outy4+x2y^4+x^2
Scope #

A pure function as a test keeps the positives

live ↗
InFilter([1,−1,2,−2,3],_1⁡↦0<_1⁡)\mathrm{Filter}(\bigl\lbrack1, -1, 2, -2, 3\bigr\rbrack, \operatorname{\_1}↦0\lt\operatorname{\_1})Out[1,2,3]\bigl\lbrack1, 2, 3\bigr\rbrack

Tabulates n2+1n^2+1 using a pure function

live ↗
InArray(_1⁡↦_1⁡2+1,10)\mathrm{Array}(\operatorname{\_1}↦\operatorname{\_1}^2+1, 10)Out[2,5,10,17,26,37,50,65,82,101]\bigl\lbrack2, 5, 10, 17, 26, 37, 50, 65, 82, 101\bigr\rbrack

A two-argument function orders pairs by second component

live ↗
InSort([[a,2],[c,1],[d,3]],(_1⁡,_2⁡)↦_1⁡[2]<_2⁡[2])\mathrm{Sort}(\bigl\lbrack\bigl\lbrack a, 2\bigr\rbrack, \bigl\lbrack c, 1\bigr\rbrack, \bigl\lbrack d, 3\bigr\rbrack\bigr\rbrack, (\operatorname{\_1}, \operatorname{\_2})↦\operatorname{\_1}[2]\lt\operatorname{\_2}[2])Out[[c,1],[a,2],[d,3]]\bigl\lbrack\bigl\lbrack c, 1\bigr\rbrack, \bigl\lbrack a, 2\bigr\rbrack, \bigl\lbrack d, 3\bigr\rbrack\bigr\rbrack
live ↗
In(x↦x2)′(x↦x^2)^{\prime}Outx↦2xx↦2x
Properties #

A function with no slots ignores its argument

live ↗
InMap(()↦17,[1,2,3])\mathrm{Map}(()↦17, \bigl\lbrack1, 2, 3\bigr\rbrack)Out[17,17,17]\bigl\lbrack17, 17, 17\bigr\rbrack

Tabulates the first ten squares

live ↗
InArray(_1⁡↦_1⁡2,10)\mathrm{Array}(\operatorname{\_1}↦\operatorname{\_1}^2, 10)Out[1,4,9,16,25,36,49,64,81,100]\bigl\lbrack1, 4, 9, 16, 25, 36, 49, 64, 81, 100\bigr\rbrack
live ↗
InReplaceAll(_1⁡↦p+_1⁡,Rule(p,q))\mathrm{ReplaceAll}(\operatorname{\_1}↦p+\operatorname{\_1}, \mathrm{Rule}(p, q))Out_1⁡↦_1⁡+q\operatorname{\_1}↦\operatorname{\_1}+q
live ↗
In(x↦y↦xy)(x)⊲y(x↦y↦x^{y})(x)\lhd yOutxyx^{y}
live ↗
In(y↦x↦yx)(x)⊲y(y↦x↦y^{x})(x)\lhd yOutxyx^{y}
live ↗
In(x↦x↦xx)(x)⊲y(x↦x↦x^{x})(x)\lhd yOutyyy^{y}
live ↗
In(x↦y↦xy)(a)⊲b(x↦y↦x^{y})(a)\lhd bOutaba^{b}
About
Examples15
Checked againstWolfram Language 15 agree
CrosswalkWolfram Language