Exercise 1.29 in Guile Scheme