Skip to content

Instantly share code, notes, and snippets.

@taiki45
Created July 12, 2012 08:29
Show Gist options
  • Save taiki45/3096713 to your computer and use it in GitHub Desktop.
Save taiki45/3096713 to your computer and use it in GitHub Desktop.
s = 1, 3, ... 99 をすべて足す
(define (make-list proc st en)
(cond ((= st en) (cons (proc en) '()))
(else (cons (proc st)
(make-list proc
(+ st 1)
en)))))
(reduce + 0 (make-list (lambda (n) (+ 1 (* 2 n))) 0 49))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment