;;;; Section 1.5 ;;;; ;Adam Nelson ;Chet Tobrey (defun last-name (name) "Select the last name from a name represented as a list." (first (last name))) (defun first-name (name) "Select the first name from a name represented as a list." (first name)) (setf names '((John Q Public) (Malcolm X) (Admiral Grace Murray Hopper) (Spot) (Aristotle) (A A Milne) (Z Z Top) (Sir Larry Olivier) (Miss Scarlet))) (egs :1.5 (eg '(last-name p) :of "Testing the last-name function with the list p" :out 'Public) (eg '(last-name '(Rear Admiral Grace Murray Hopper)) :of "Testing the last-name function with another list" :out 'Hopper) (eg '(last-name '(Rex Morgan MD)) :of "Testing with yet another list..." :out 'MD) (eg '(last-name '(Spot)) :of "Testing with yet another list..." :out 'Spot) (eg '(last-name '(Aristotle)) :of "Testing with yet another list..." :out 'Aristotle) (eg 'p :of "What is the list?" :out '(John Q Public)) (eg '(first-name p) :of "First name of the list p" :out 'John) (eg '(first-name '(Wilma Flintstone)) :of "Wilma's first name" :out 'Wilma) (eg '(first-name (first names)) :of "Getting the first name of a larger list of names via the first-name function" :out 'John))