previous | index | next

A List of Pattern/Action Pairs

The behavior of the query system will be determined by a list of pattern/action pairs.
     (define movie-p/a-list
       (list
         (make-pattern/action
              '(who is the director of ...)
              (lambda (title)
                (movies-satisfying
                 our-movie-database
                 (lambda (movie)
                   (equal? (movie-title movie)
                           title))
                 movie-director)))
         (make-pattern/action
              ...another pattern...
              ...another action...)
         ...))

previous | index | next