Functions
Nested Function Application
$ wo 'Plus[Divide[6, 2], Abs[-5]]'
8
Anonymous Identity Function
$ wo '#&[1]'
1
Function Application
$ wo '#^2 &[{1, 2, 3}]'
{1, 4, 9}
/@ (Map)
Apply a function to each element of a list.
$ wo 'Sign /@ {7, -2, 0, -5}'
{1, -1, 0, -1}
$ wo '#^2& /@ {1, 2, 3}'
{1, 4, 9}
$ wo 'Sin@(Pi/2)'
1
$ wo '(Pi/2) // Sin'
1
Define And Use A Function
$ wo 'Double[x_] := x * 2; Double[5]'
10
$ wo 'Double[x_] := x * 2; Double[Sin[Pi/2]]'
2
$ wo 'Double[x_] := x * 2; Double @ Sin @ (Pi/2)'
2
$ wo 'Double[x_] := x * 2; (Pi/2) // Sin // Double'
2
Apply (@@)
Replaces the head of an expression with a function.
$ wo 'f @@ {1, 2, 3}'
f[1, 2, 3]
Fold
Applies a function cumulatively to elements of a list, starting with an initial value.
$ wo 'Fold[Plus, 0, {1, 2, 3}]'
6
FoldList
Like Fold, but returns a list of intermediate results.
$ wo 'FoldList[Plus, 0, {1, 2, 3}]'
{0, 1, 3, 6}
Nest
Applies a function repeatedly to an expression.
$ wo 'Nest[f, x, 3]'
f[f[f[x]]]
NestList
Like Nest, but returns a list of intermediate results.
$ wo 'NestList[f, x, 3]'
{x, f[x], f[f[x]], f[f[f[x]]]}
DateString
$ wo 'StringStartsQ[DateString[Now, "ISODateTime"], "2025-"]'
True