Next: vectors fold unfold, Previous: vectors fold rnrs, Up: vectors fold [Index]
Fold combine over each item of the selected subvector, return the return value of the last evaluated call to combine; if the selected subvector is empty, the return value is knil. The left–fold operator builds the return value as:
(combine
  (combine
        ...
        (combine
           (combine
              (vector-ref vec start)
              knil)
           (vector-ref vec (+ start 1)))
        ...
    (vector-ref vec (- past 2)))
    ...
  (vector-ref vec (- past 1)))
the right–fold iterator builds the return value as:
(combine
  (vector-ref vec start
  (combine
    (vector-ref vec (+ start 1))
    ...
      (combine
        (vector-ref vec (- past 3))
        (combine
           (vector-ref vec (- past 2))
           (combine
              (vector-ref vec (- past 1))
              knil)))))