Skip to content

Instantly share code, notes, and snippets.

Created July 18, 2012 05:52
Show Gist options
  • Select an option

  • Save anonymous/3134464 to your computer and use it in GitHub Desktop.

Select an option

Save anonymous/3134464 to your computer and use it in GitHub Desktop.
;;doesn't work
(define (repeat f n)
(if (> n1)
(lambda (x) (f (repeat f (- n 1))))
f))
;;works
(define (compose f g)
(lambda(x) (f (g x))))
(define (repeat f n)
(if (> n 1)
(compose f (repeat f (- n 1)))
f))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment