Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- (define (vector-reduce mass func num)
- (define (loop i acc)
- (if (= i (vector-length mass))
- acc
- (loop (+ i 1) (func acc (vector-ref mass i)))
- ))
- (loop 0 num))
- (display (vector-reduce (vector 1 2 3 4 5) + 0))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement