# Command: FoldList

NEST HelpDesk | Command Index | NEST Quick Reference

Name:

    FoldList - repeatedly apply a function with two parameters

Synopsis:

    x [a b c ...] f FoldList -> [f(x,a) f(f(x,a),b) ...]

Examples:

    0 [1 2 3 4] {add} FoldList gives the cumulative sums of the list.
      0 [1 2 3 4] {add} FoldList -> [0 1 3 6 10]

Remarks:

    This function is Mathematica compatible.

SeeAlso:

- NestList
- Fold
- Map
- forall

Source:

    /opt/conda/conda-bld/nest_1531570948828/work/lib/sli/mathematica.sli

NEST HelpDesk | Command Index | NEST Quick Reference

© 2004 The NEST Initiative