Exercise 1.23 in Clojure