Exercise 1.22 in Clojure