Skip to content

Instantly share code, notes, and snippets.

@yao2030
Created December 6, 2012 02:36
Show Gist options
  • Save yao2030/4221385 to your computer and use it in GitHub Desktop.
Save yao2030/4221385 to your computer and use it in GitHub Desktop.
(define (filtered-accumulate combiner null-value term a next b predicate)
(if (> a b)
null-value
(combiner (if (predicate (term a))
(term a)
null-value)
(filtered-accumulate combiner null-value term (next a) next b predicate))))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment