Exercise 1.35 in Common Lisp