June 2014
Intermediate to advanced
946 pages
23h 40m
English
Man is a tool-using animal…Without tools he is nothing with tools he is all.
–Thomas Carlyle (1795–1881)
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."
(loop
(print 'eliza >)
(print (flatten (use-eliza-rules (read))))))
Many other applications use this pattern, including Lisp itself. The top ...
Read now
Unlock full access