Skip to content

Instantly share code, notes, and snippets.

@rightfold
Last active December 25, 2015 08:49
Show Gist options
  • Save rightfold/1319b6eefde88bf1a653 to your computer and use it in GitHub Desktop.
Save rightfold/1319b6eefde88bf1a653 to your computer and use it in GitHub Desktop.
(define fib
(lambda (n)
(case n
((1) 0)
((2) 1)
(else (+ (fib (- n 1)) (fib (- n 2)))))))
(define ..
(lambda (b e)
(if (> b e)
(reverse (.. e b))
(if (= b e)
(cons b '())
(cons b (.. (+ b 1) e))))))
(print (map fib (.. 1 20)))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment