Exercise 1.23 in Guile Scheme