In chapters 4 and 5 we were concerned with building two particular programs, GPS and ELIZA In this chapter, we will reexamine those two programs to discover some common patterns. Those patterns will be abstracted out to form reusable software tools that will prove helpful in subsequent chapters.
The structure of the function eliza is a common one. It is repeated below:
(defun eliza ()
"Respond to user input using pattern matching rules."
(print 'eliza >)
(print (flatten (use-eliza-rules (read))))))
Many other applications use this pattern, including Lisp itself. The top ...