Exercise 1.29 in Clojure