chickadee » srfi-133 » vector-cumulate

vector-cumulate f knil vecprocedure

Returns a newly allocated vector new with the same length as vec. Each element i of new is set to the result of invoking f on newi-1 and veci, except that for the first call on f, the first argument is knil. The new vector is returned.

Example:

(vector-cumulate + 0 '#(3 1 4 1 5 9 2 5 6))
 ;=> #(3 4 8 9 14 23 25 30 36)