vector foldr - part-cw/lambdanative GitHub Wiki
(vector-foldr fcn base vec)
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))