Exercise 1.28 in Common Lisp