Exercise 1.24 in Clojure