This is documentation for Mathematica 7, which was
based on an earlier version of the Wolfram Language.
 Functional Programming Long viewed as an important theoretical idea, functional programming finally became truly convenient and practical with the introduction of Mathematica's symbolic language. Treating expressions like f[x] as both symbolic data and the application of a function f provides a uniquely powerful way to integrate structure and function—and an efficient, elegant representation of many common computations. Function (&) — specify a pure function (e.g. (#+1)&) #, ## — slots for variables in a pure function Map (/@) — map across a list: f/@{x, y, z}{f[x], f[y], f[z]} Apply (@@, @@@) — apply to a list: f@@{x, y, z}f[x, y, z] MapIndexed — map with index information: {f[x, {1}], f[y, {2}], f[z, {3}]} Nest, NestList — nest a function: f[f[f[x]]] etc. Fold, FoldList — fold in a list of values: f[f[f[x, 1], 2], 3] etc. FixedPoint, FixedPointList — repeatedly nest until a fixed point List-Oriented Functions Select — select from a list according to a function Array — create an array from a function Sort, Split — sort, split according to a function Functional Composition Operations TUTORIALS Pure Functions Variables in Pure Functions and Rules Applying Functions to Lists and Other Expressions Applying Functions to Parts of Expressions Applying Functions Repeatedly Selecting Parts of Expressions with Functions Working with Operators MORE ABOUT List Manipulation Rule-Based Programming Expressions RELATED LINKS How to: Work with Lists