Exercise 1.30 in Clojure