|
SOLUTIONS
|
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
as both symbolic data and the application of a function
provides a uniquely powerful way to integrate structure and function—and an efficient, elegant representation of many common computations.
Learning ResourcesLearning Resources
Related Web Resources Training CoursesCommunity |
Featured ExamplesFeatured Examples |
-
Arbitrarily Nested Tables
-
Automatically Parallelize Computations
-
Create Tables of Results in Parallel
-
Find and Visualize Matching Points in Two Images
-
Find Successive Nearest Words in Text
-
Find Symbols That Match a Pattern
-
Flatten Nested Arrays
-
Fractal Explorations
-
Graph Layouts
-
Highlight Connected Components in a Directed Graph
-
Show Gray Codes of a Given Length
-
Successively Replace Entries in an Array
-
Use Any Expression with a Function
ReferenceReference
Function (&) — specify a pure function (e.g.
)
#, ## — slots for variables in a pure function
Applying Functions to Lists »
Apply (@@, @@@) — apply to a list: ![]()
![]()
![]()
MapIndexed — map with index information: ![]()
MapThread ▪ MapAt ▪ MapAll ▪ Scan ▪ ...
Iteratively Applying Functions »
Nest, NestList — nest a function:
etc.
Fold, FoldList — fold in a list of values:
etc.
FixedPoint, FixedPointList — repeatedly nest until a fixed point
NestWhile ▪ NestWhileList ▪ TakeWhile ▪ LengthWhile ▪ ...
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
Identity ▪ Composition ▪ Operate ▪ Through ▪ Distribute
