Exercise 1.30 in Guile Scheme