programming pearls's exercise