Exercise 1.22 in Guile Scheme