previous | index | next

Exercises

Exercise 7.23: Pass in a predicate to a general procedure that returns the titles of the movies satisfying the predicate:
     (titles-of-movies-satisfying database predicate)

Ex:  (titles-of-movies-satisfying 
       our-movie-database 
       (lambda (movie) (= (movie-year-made movie) 1974))
     ⇒ ((amarcord))
Exercise 7.24: Generalize 7.23 so that any movie selector can be used:
     (movies-satisfying database predicate selector)

Ex:  (movies-satisfying 
       our-movie-database 
       (lambda (movie) (= (movie-year-made movie) 1974))
       movie-director)
     ⇒ ((federico fellini))

previous | index | next