Created
January 16, 2012 01:30
-
-
Save dyba/1618486 to your computer and use it in GitHub Desktop.
Clojure Koans - Stuck
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defn is-even? [n] | |
(if (= n 0) | |
(not false) | |
(recur (is-even? (dec n))))) | |
(meditations | |
"Recursion ends with a base case" | |
(= true (is-even? 0)) | |
"And starts by moving toward that base case" | |
(= false (is-even? 1))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment