This is documentation for Mathematica 5, which was
based on an earlier version of the Wolfram Language.
View current documentation (Version 11.2)

Documentation / Mathematica / Built-in Functions / Programming / Functional Programming /


FilledSmallSquare FoldList[f, x, a, b, ... ] gives x, f[x, a], f[f[x, a], b], ... .

FilledSmallSquare Example: FoldList[f, x, a, b, c] LongRightArrow.

FilledSmallSquare FoldList[Plus, 0, list] generates cumulative sums of the elements in list.

FilledSmallSquare Example: FoldList[Plus, 0, a, b, c] LongRightArrow.

FilledSmallSquare With a length list, FoldList generates a list of length .

FilledSmallSquare The head of list in FoldList[f, x, list] need not be List.

FilledSmallSquare See Section 2.2.2.

FilledSmallSquare See also: Fold, NestList, ComposeList, Partition, MapIndexed.

FilledSmallSquare New in Version 2.

Further Examples