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

accumulate(Function,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(plus, 0 .. 10)

o2 = (1, 3, 6, 10, 15, 21, 28, 36, 45, 55)

o2 : Sequence