Exercise 1.24 in Guile Scheme