next | previous | forward | backward | up | top | index | toc | home

accumulate(Function,Thing,VisibleList)

Synopsis

Description

accumulate(f,x0,{x1,...,xn}) -- computes the list {f(x0,x1),f(f(x0,x1),x2),...}.
i1 : accumulate(identity, a, {b,c,d,e})

o1 = {(a, b), ((a, b), c), (((a, b), c), d), ((((a, b), c), d), e)}

o1 : List
i2 : accumulate (times, 1, 1 .. 10)

o2 = (1, 2, 6, 24, 120, 720, 5040, 40320, 362880, 3628800)

o2 : Sequence