Exercise 1.32 in Common Lisp