Skip to content
Chris Petersen edited this page Oct 16, 2014 · 2 revisions

vector-foldr folds a vector to the right. It is the equivalent of lists' (foldr).

Parameter Description
fcn Function applied
base starting value
vec Vector operate on

Example

Example 1: The definitions of vector-sum and vector-product

(define (vector-sum vec) (vector-foldr + 0 vec))
(define (vector-product vec) (vector-foldr * 1 vec))
Clone this wiki locally