Skip to content

Instantly share code, notes, and snippets.

@dyba
Created January 16, 2012 01:30
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dyba/1618486 to your computer and use it in GitHub Desktop.
Save dyba/1618486 to your computer and use it in GitHub Desktop.
Clojure Koans - Stuck
(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