Exercise 1.21 in Emacs Lisp